I want to compile project "pluma".I use mingw,and open this project with codeblock with default cbp.The first two project go well, with following log:
mingw32-g++.exe -std=c++0x -Wall -DPLUMA_EXPORTS -g -O0 -I..\..\include -I..\..\src -c F:\workspace\mec\Pluma-1.1\src\Pluma\Dir.cpp -o ..\..\ztemp\mingw\debug\src\Pluma\Dir.omingw32-g++.exe -std=c++0x -Wall -DPLUMA_EXPORTS -g -O0 -I..\..\include -I..\..\src -c F:\workspace\mec\Pluma-1.1\src\Pluma\DLibrary.cpp -o ..\..\ztemp\mingw\debug\src\Pluma\DLibrary.omingw32-g++.exe -std=c++0x -Wall -DPLUMA_EXPORTS -g -O0 -I..\..\include -I..\..\src -c F:\workspace\mec\Pluma-1.1\src\Pluma\Host.cpp -o ..\..\ztemp\mingw\debug\src\Pluma\Host.omingw32-g++.exe -std=c++0x -Wall -DPLUMA_EXPORTS -g -O0 -I..\..\include -I..\..\src -c F:\workspace\mec\Pluma-1.1\src\Pluma\PluginManager.cpp -o ..\..\ztemp\mingw\debug\src\Pluma\PluginManager.omingw32-g++.exe -std=c++0x -Wall -DPLUMA_EXPORTS -g -O0 -I..\..\include -I..\..\src -c F:\workspace\mec\Pluma-1.1\src\Pluma\Provider.cpp -o ..\..\ztemp\mingw\debug\src\Pluma\Provider.omingw32-g++.exe -shared -Wl,--out-implib=..\..\lib\libpluma-d.a -Wl,--dll ..\..\ztemp\mingw\debug\src\Pluma\Dir.o ..\..\ztemp\mingw\debug\src\Pluma\DLibrary.o ..\..\ztemp\mingw\debug\src\Pluma\Host.o ..\..\ztemp\mingw\debug\src\Pluma\PluginManager.o ..\..\ztemp\mingw\debug\src\Pluma\Provider.o -o ..\..\lib\pluma-d.dll Output file is ..\..\lib\pluma-d.dll with size 1.36 MBProcess terminated with status 0 (0 minute(s), 1 second(s))0 error(s), 0 warning(s) (0 minute(s), 1 second(s))
mingw32-g++.exe -Wall -DPLUGIN_EXPORTS -g -O0 -I..\..\..\include -I..\..\src\interface -I..\..\src\plugin -c F:\workspace\mec\Pluma-1.1\example\src\interface\Warrior.cpp -o ..\..\..\ztemp\mingw\elite-warriors\debug\src\interface\Warrior.omingw32-g++.exe -Wall -DPLUGIN_EXPORTS -g -O0 -I..\..\..\include -I..\..\src\interface -I..\..\src\plugin -c F:\workspace\mec\Pluma-1.1\example\src\plugin\Connector.cpp -o ..\..\..\ztemp\mingw\elite-warriors\debug\src\plugin\Connector.omingw32-g++.exe -shared -Wl,--dll -L..\..\..\lib ..\..\..\ztemp\mingw\elite-warriors\debug\src\interface\Warrior.o ..\..\..\ztemp\mingw\elite-warriors\debug\src\plugin\Connector.o -o ..\..\bin\plugins\elite-warriors-d.dll -lpluma-d Output file is ..\..\bin\plugins\elite-warriors-d.dll with size 269.04 KBProcess terminated with status 0 (0 minute(s), 1 second(s))0 error(s), 0 warning(s) (0 minute(s), 1 second(s))
But when I compile the third project and link with the lib generated before.I get following log:
mingw32-g++.exe -Wall -g -O0 -I..\..\..\include -I..\..\src\interface -I..\..\src\host -c F:\workspace\mec\Pluma-1.1\example\src\host\Main.cpp -o ..\..\..\ztemp\mingw\aztec-warfare\debug\src\host\Main.omingw32-g++.exe -Wall -g -O0 -I..\..\..\include -I..\..\src\interface -I..\..\src\host -c F:\workspace\mec\Pluma-1.1\example\src\interface\Warrior.cpp -o ..\..\..\ztemp\mingw\aztec-warfare\debug\src\interface\Warrior.omingw32-g++.exe -L..\..\..\lib -L..\..\..\lib -o ..\..\bin\aztecs-d.exe ..\..\..\ztemp\mingw\aztec-warfare\debug\src\host\Main.o ..\..\..\ztemp\mingw\aztec-warfare\debug\src\interface\Warrior.o -lpluma-d F:\workspace\mec\Pluma-1.1\example\src\host\Main.cpp: In function 'int main()':F:\workspace\mec\Pluma-1.1\example\src\host\Main.cpp:30:16: warning: deleting object of abstract class type 'Warrior' which has non-virtual destructor will cause undefined behavior [-Wdelete-non-virtual-dtor] 30 | delete warrior; | ^~~~~~~d:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: ..\..\..\ztemp\mingw\aztec-warfare\debug\src\host\Main.o: in function `main':F:/workspace/mec/Pluma-1.1/example/src/host/Main.cpp:15: undefined reference to `_imp___ZN5pluma13PluginManager14loadFromFolderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb'd:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: ..\..\..\ztemp\mingw\aztec-warfare\debug\src\host\Main.o: in function `ZN5pluma5Pluma18acceptProviderTypeI15WarriorProviderEEvv':F:\workspace\mec\Pluma-1.1\example\build\mingw/../../../include/Pluma/Pluma.inl:35: undefined reference to `_imp___ZN5pluma13PluginManager12registerTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjj'd:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: ..\..\..\ztemp\mingw\aztec-warfare\debug\src\host\Main.o: in function `ZN5pluma5Pluma12getProvidersI15WarriorProviderEEvRSt6vectorIPT_SaIS5_EE':F:\workspace\mec\Pluma-1.1\example\build\mingw/../../../include/Pluma/Pluma.inl:46: undefined reference to `_imp___ZNK5pluma13PluginManager12getProvidersERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'collect2.exe: error: ld returned 1 exit status
However,I use "nm libpluma-d.a" to check out the symbols,I see:
00000000 I __imp___ZN5pluma13PluginManager14loadFromFolderERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb00000000 I __imp___ZN5pluma13PluginManager12registerTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEjj00000000 I __imp___ZNK5pluma13PluginManager12getProvidersERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
These symbols are existed, but only they are prefixed with "__imp".There is another "_" in the prefix.Is this the problem?How can I fix it?