Hi all,
Sorry if its a bit long
I’ve been trying to solve a problem linking a project that uses panda3D but I’m quite stuck at this moment.
I’m working on a project which has several modules, each module is a static library, and I’m trying to use Panda3D in one of them.
The plot is like this:
[EDIT]: Sorry I forgot to mentions that I use MSVC 2008 Express
iprod (my static library in which I want to use panda)
Additional Include Directories:
.
…..\src
…..\extern\include
…..\extern\include\panda3d
…..\extern\include\panda3d\python
…..\extern\include\panda3d\python
(I use the same include both for debug and release)
Additional Dependencies:
cored.lib
libp3framework.lib
libpanda.lib
libpandafx.lib
libpandaexpress.lib
libp3dtool.lib
libp3dtoolconfig.lib
libp3pystub.lib
libp3direct.lib
(they’re in separate folders for debug and release)
Additional Library Directories:
…..\bin
…..\extern\lib
…..\extern\lib\panda3d\debug
…..\extern\lib\panda3d\debug\python\Lib
…..\extern\lib\panda3d\debug\python\libs
$(OutDir)
(the same for release, using release instead of debug)
The project compiles and links fine. I just get some warnings, but I think they’re not related to the problem.
1>------ Build started: Project: iprod, Configuration: Debug Win32 ------
1>Compiling…
1>mainprod.cpp
1>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\python\pyconfig.h(51) : warning C4005: ‘HAVE_IO_H’ : macro redefinition
1> c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\dtool_config.h(56) : see previous definition of ‘HAVE_IO_H’
1>Creating library…
1>libp3framework.lib(libp3framework.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in cored.lib(cored.dll); second definition ignored
1>libp3framework.lib(libp3framework.dll) : warning LNK4221: no public symbols found; archive member will be inaccessible
1>libpanda.lib(libpanda.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in cored.lib(cored.dll); second definition ignored
1>libpanda.lib(libpanda.dll) : warning LNK4221: no public symbols found; archive member will be inaccessible
1>libpandafx.lib(libpandafx.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in cored.lib(cored.dll); second definition ignored
1>libpandafx.lib(libpandafx.dll) : warning LNK4221: no public symbols found; archive member will be inaccessible
1>libpandaexpress.lib(libpandaexpress.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in cored.lib(cored.dll); second definition ignored
1>libpandaexpress.lib(libpandaexpress.dll) : warning LNK4221: no public symbols found; archive member will be inaccessible
1>libp3dtool.lib(libp3dtool.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in cored.lib(cored.dll); second definition ignored
1>libp3dtool.lib(libp3dtool.dll) : warning LNK4221: no public symbols found; archive member will be inaccessible
1>libp3dtoolconfig.lib(libp3dtoolconfig.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in cored.lib(cored.dll); second definition ignored
1>libp3dtoolconfig.lib(libp3dtoolconfig.dll) : warning LNK4221: no public symbols found; archive member will be inaccessible
1>libp3pystub.lib(libp3pystub.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in cored.lib(cored.dll); second definition ignored
1>libp3pystub.lib(libp3pystub.dll) : warning LNK4221: no public symbols found; archive member will be inaccessible
1>libp3direct.lib(libp3direct.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in cored.lib(cored.dll); second definition ignored
1>libp3direct.lib(libp3direct.dll) : warning LNK4221: no public symbols found; archive member will be inaccessible
1>Build log was saved at “file://c:\Users\Quantum\Documents\My Dropbox\PFC\project-VOX\src\iprod\Debug\BuildLog.htm”
1>iprod - 0 error(s), 17 warning(s)
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
So, I try to add my module to my main project:
vox (my main project)
Additional Include Directories:
.
…..\src
…..\extern\include
…..\extern\include\opencv
…..\extern\include\panda3d
…..\extern\include\panda3d\python
…..\extern\include\wxwidgets
…..\extern\include\wxwidgets\msvc
(I use the same include both for debug and release)
Additional Dependencies: (my libs)
cored.lib
iguid.lib
iperceptd.lib
iprodd.lib
Additional Library Directories:
…..\bin
…..\extern\lib
…..\extern\bin
$(OutDir)
(the same for release, but libs without final ‘d’)
At this point It compiles without errors, though with some warnings, but I think that not related. The point is that when linking, the linker asks for python25.lib.
5>------ Build started: Project: vox, Configuration: Debug Win32 ------
5>Compiling…
5>cl : Command line warning D9035 : option ‘Wp64’ has been deprecated and will be removed in a future release
5>main.cpp
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\stl_compares.I(135) : warning C4311: ‘reinterpret_cast’ : pointer truncation from ‘const void *’ to ‘unsigned long’
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\python\pyconfig.h(51) : warning C4005: ‘HAVE_IO_H’ : macro redefinition
5> c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\dtool_config.h(56) : see previous definition of ‘HAVE_IO_H’
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\python\pyconfig.h(160) : warning C4005: ‘HAVE_SSIZE_T’ : macro redefinition
5> c:\Users\Quantum\Documents\My Dropbox\PFC\project-VOX\extern\include\wxwidgets\wx/defs.h(1084) : see previous definition of ‘HAVE_SSIZE_T’
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\checksumHashGenerator.I(71) : warning C4311: ‘type cast’ : pointer truncation from ‘void *’ to ‘long’
5>Application.cpp
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\stl_compares.I(135) : warning C4311: ‘reinterpret_cast’ : pointer truncation from ‘const void *’ to ‘unsigned long’
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\python\pyconfig.h(51) : warning C4005: ‘HAVE_IO_H’ : macro redefinition
5> c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\dtool_config.h(56) : see previous definition of ‘HAVE_IO_H’
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\python\pyconfig.h(160) : warning C4005: ‘HAVE_SSIZE_T’ : macro redefinition
5> c:\Users\Quantum\Documents\My Dropbox\PFC\project-VOX\extern\include\wxwidgets\wx/defs.h(1084) : see previous definition of ‘HAVE_SSIZE_T’
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\checksumHashGenerator.I(71) : warning C4311: ‘type cast’ : pointer truncation from ‘void *’ to ‘long’
5>Generating Code…
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\opencv\cxoperations.hpp(81) : warning C4793: ‘anonymous namespace'::CV_XADD' : function compiled as native : 5> Inline native assembly not supported in managed code 5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\opencv\cxoperations.hpp(81) : warning C4793: '
anonymous namespace’::CV_XADD’ : function compiled as native :
5> Inline native assembly not supported in managed code
5>Linking…
5>LINK : fatal error LNK1104: cannot open file ‘python25.lib’
5>Build log was saved at “file://c:\Users\Quantum\Documents\My Dropbox\PFC\project-VOX\apps\vox\Debug_msvc\BuildLog.htm”
5>vox - 1 error(s), 11 warning(s)
========== Build: 4 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
I don’t really get the point why it’s asking for it, but just to give it a try I add “…..\extern\lib\panda3d\debug\python\libs” to the Additional Library Directories. And this is when I get my errors: Unresolved tokens and external symbols
1>------ Build started: Project: vox, Configuration: Debug Win32 ------
1>Linking…
1>Application.obj : warning LNK4248: unresolved typeref token (01000019) for ‘wxEventLoopBase’; image may not run
1>Application.obj : warning LNK4248: unresolved typeref token (0100001A) for ‘wxVideoMode’; image may not run
1>main.obj : warning LNK4248: unresolved typeref token (0100001B) for ‘Pipeline’; image may not run
1>Application.obj : warning LNK4248: unresolved typeref token (0100001D) for ‘Pipeline’; image may not run
1>iperceptd.lib(mainpercept.obj) : warning LNK4248: unresolved typeref token (01000019) for ‘CvCapture’; image may not run
1>main.obj : error LNK2020: unresolved token (0A003102) “private: static class TypeHandle GeomVertexData::CDataCache::_type_handle” (?_type_handle@CDataCache@GeomVertexData@@0VTypeHandle @@A )
1>Application.obj : error LNK2020: unresolved token (0A003121) “private: static class TypeHandle GeomVertexData::CDataCache::_type_handle” (?_type_handle@CDataCache@GeomVertexData@@0VTypeHandle @@A )
1>main.obj : error LNK2020: unresolved token (0A0032B6) “private: static class TypeHandle Geom::CDataCache::_type_handle” (?_type_handle@CDataCache@Geom@@0VTypeHandle @@A )
1>Application.obj : error LNK2020: unresolved token (0A0032DC) “private: static class TypeHandle Geom::CDataCache::_type_handle” (?_type_handle@CDataCache@Geom@@0VTypeHandle @@A )
1>main.obj : error LNK2028: unresolved token (0A003A87) “public: virtual __thiscall Geom::CDataCache::~CDataCache(void)” (??1CDataCache@Geom@@$$FUAE@XZ) referenced in function “[T2M] protected: void __thiscall std::vector<class NodePath,class pallocator_array >::_Tidy(void)” (__t2m@?_Tidy@?$vector@VNodePath@@V ?$pallocator_array@VNodePath@@@@@std @@IAEXXZ )
1>Application.obj : error LNK2028: unresolved token (0A003AC8) “public: virtual __thiscall Geom::CDataCache::~CDataCache(void)” (??1CDataCache@Geom@@$$FUAE@XZ) referenced in function “public: virtual void * __thiscall Geom::CDataCache::vector deleting destructor'(unsigned int)" (??_ECDataCache@Geom@@$$FUAEPAXI@Z) 1>Application.obj : error LNK2001: unresolved external symbol "public: virtual class CycleData * __thiscall GeomVertexData::CDataCache::make_copy(void)const " (?make_copy@CDataCache@GeomVertexData@@UBEPAVCycleData@@XZ) 1>main.obj : error LNK2001: unresolved external symbol "public: virtual class CycleData * __thiscall GeomVertexData::CDataCache::make_copy(void)const " (?make_copy@CDataCache@GeomVertexData@@UBEPAVCycleData@@XZ) 1>Application.obj : error LNK2001: unresolved external symbol "private: static class TypeHandle GeomVertexData::CDataCache::_type_handle" (?_type_handle@CDataCache@GeomVertexData@@0VTypeHandle@@A) 1>main.obj : error LNK2001: unresolved external symbol "private: static class TypeHandle GeomVertexData::CDataCache::_type_handle" (?_type_handle@CDataCache@GeomVertexData@@0VTypeHandle@@A) 1>Application.obj : error LNK2001: unresolved external symbol "public: virtual class CycleData * __thiscall Geom::CDataCache::make_copy(void)const " (?make_copy@CDataCache@Geom@@UBEPAVCycleData@@XZ) 1>main.obj : error LNK2001: unresolved external symbol "public: virtual class CycleData * __thiscall Geom::CDataCache::make_copy(void)const " (?make_copy@CDataCache@Geom@@UBEPAVCycleData@@XZ) 1>Application.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Geom::CDataCache::~CDataCache(void)" (??1CDataCache@Geom@@$$FUAE@XZ) referenced in function "public: virtual void * __thiscall Geom::CDataCache::
vector deleting destructor’(unsigned int)” (??_ECDataCache@Geom@@$$FUAEPAXI@Z)
1>main.obj : error LNK2001: unresolved external symbol “public: virtual __thiscall Geom::CDataCache::~CDataCache(void)” (??1CDataCache@Geom@@$$FUAE@XZ)
1>Application.obj : error LNK2001: unresolved external symbol “private: static class TypeHandle Geom::CDataCache::_type_handle” (?_type_handle@CDataCache@Geom@@0VTypeHandle @@A )
1>main.obj : error LNK2001: unresolved external symbol “private: static class TypeHandle Geom::CDataCache::_type_handle” (?_type_handle@CDataCache@Geom@@0VTypeHandle @@A )
1>…/…/bin\voxd.exe : fatal error LNK1120: 11 unresolved externals
1>Build log was saved at “file://c:\Users\Quantum\Documents\My Dropbox\PFC\project-VOX\apps\vox\Debug_msvc\BuildLog.htm”
1>vox - 17 error(s), 5 warning(s)
========== Build: 0 succeeded, 1 failed, 6 up-to-date, 0 skipped ==========
(the same happends in release, just a few less errors)
5>------ Build started: Project: vox, Configuration: Release Win32 ------
5>Compiling…
5>main.cpp
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\python\pyconfig.h(51) : warning C4005: ‘HAVE_IO_H’ : macro redefinition
5> c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\dtool_config.h(56) : see previous definition of ‘HAVE_IO_H’
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\python\pyconfig.h(160) : warning C4005: ‘HAVE_SSIZE_T’ : macro redefinition
5> c:\Users\Quantum\Documents\My Dropbox\PFC\project-VOX\extern\include\wxwidgets\wx/defs.h(1084) : see previous definition of ‘HAVE_SSIZE_T’
5>Application.cpp
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\python\pyconfig.h(51) : warning C4005: ‘HAVE_IO_H’ : macro redefinition
5> c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\dtool_config.h(56) : see previous definition of ‘HAVE_IO_H’
5>c:\users\quantum\documents\my dropbox\pfc\project-vox\extern\include\panda3d\python\pyconfig.h(160) : warning C4005: ‘HAVE_SSIZE_T’ : macro redefinition
5> c:\Users\Quantum\Documents\My Dropbox\PFC\project-VOX\extern\include\wxwidgets\wx/defs.h(1084) : see previous definition of ‘HAVE_SSIZE_T’
5>Linking…
5>Application.obj : error LNK2001: unresolved external symbol "public: virtual class CycleData * __thiscall GeomVertexData::CDataCache::make_copy(void)const " (?make_copy@CDataCache@GeomVertexData@@UBEPAVCycleData @@XZ )
5>Application.obj : error LNK2001: unresolved external symbol "public: virtual class CycleData * __thiscall Geom::CDataCache::make_copy(void)const " (?make_copy@CDataCache@Geom@@UBEPAVCycleData @@XZ )
5>Application.obj : error LNK2001: unresolved external symbol "public: virtual class CycleData * __thiscall Geom::CDataCache::make_copy(void)const " (?make_copy@CDataCache@Geom@@$$FUBEPAVCycleData@@XZ )
5>Application.obj : error LNK2001: unresolved external symbol “public: virtual __thiscall Geom::CDataCache::~CDataCache(void)” (??1CDataCache@Geom@@$$FUAE@XZ)
5>Application.obj : error LNK2001: unresolved external symbol "public: virtual class CycleData * __thiscall GeomVertexData::CDataCache::make_copy(void)const " (?make_copy@CDataCache@GeomVertexData@@$$FUBEPAVCycleData@@XZ )
5>Application.obj : error LNK2001: unresolved external symbol “private: static class TypeHandle Geom::CDataCache::_type_handle” (?_type_handle@CDataCache@Geom@@0VTypeHandle @@A )
5>Application.obj : error LNK2001: unresolved external symbol “private: static class TypeHandle GeomVertexData::CDataCache::_type_handle” (?_type_handle@CDataCache@GeomVertexData@@0VTypeHandle @@A )
5>…/…/bin\vox.exe : fatal error LNK1120: 7 unresolved externals
5>Build log was saved at “file://c:\Users\Quantum\Documents\My Dropbox\PFC\project-VOX\apps\vox\Release\BuildLog.htm”
5>vox - 8 error(s), 4 warning(s)
========== Build: 4 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
I don’t get the point why I need to add python25.lib in my main project, but in any case it works.
On the other hand, the unresolved errors they all seem related to Geom and GeomVertexData, so I think that maybe I’m missing a lib from panda3D, in which those symbols are defined, to get it through… I tried to find which one, but none seems to work it out, so I’m quite stuck…
Any light about this?
Thks so much!