Problem building Hello world code

Im trying to build the Hello world code in MS Visual C++ 2008 on Vista, but Im getting this error message:

1>------ Build started: Project: Panda3D_test, Configuration: Debug Win32 ------
1>Linking...
1>main.obj : warning LNK4248: unresolved typeref token (01000017) for 'Pipeline'; image may not run
1>main.obj : error LNK2020: unresolved token (0A00205A) "private: static class TypeHandle GeomVertexData::CDataCache::_type_handle" (?_type_handle@CDataCache@GeomVertexData@@0VTypeHandle@@A)
1>main.obj : error LNK2020: unresolved token (0A0020FB) "private: static class TypeHandle Geom::CDataCache::_type_handle" (?_type_handle@CDataCache@Geom@@0VTypeHandle@@A)
1>main.obj : error LNK2028: unresolved token (0A00249F) "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 class CycleData * __thiscall GeomVertexData::CDataCache::make_copy(void)const " (?make_copy@CDataCache@GeomVertexData@@UBEPAVCycleData@@XZ)
1>main.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 "public: virtual class CycleData * __thiscall Geom::CDataCache::make_copy(void)const " (?make_copy@CDataCache@Geom@@UBEPAVCycleData@@XZ)
1>main.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 "private: static class TypeHandle Geom::CDataCache::_type_handle" (?_type_handle@CDataCache@Geom@@0VTypeHandle@@A)
1>C:\Users\sami\Desktop\Sekalaiset\Koodaus\Panda3D\Panda3D_test\Debug\Panda3D_test.exe : fatal error LNK1120: 8 unresolved externals
1>Build log was saved at "file://c:\Users\sami\Desktop\Sekalaiset\Koodaus\Panda3D\Panda3D_test\Panda3D_test\Debug\BuildLog.htm"
1>Panda3D_test - 9 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  • Tried reinstalling panda, both 1.7.0 and 1.6.2
  • I have added executable, include and library paths to VC++ directories (both panda and thirdparty)
  • I have these libraries set as project dependencies: libp3framework.lib, libpanda.lib, libpandafx.lib,
    libpandaexpress.lib, libp3dtool.lib, libp3dtoolconfig.lib, libp3pystub.lib, libp3direct.lib
  • Project is set to release

Am I doing something wrong or still missing some libraries?

Thanks for help,
Sampe

First, I note that you didn’t follow all of the instructions in the Manual, because it says you’re building a “Debug” configuration, and the manual clearly says to set it to “Release” configuration or your program will crash it horrible ways.

It also appears that you didn’t successfully add libpanda.lib to your list of libraries. (This is the library that provides these symbols.) Try taking another look at your project settings.

David

Now configuration set to release and these libraries set to Properties -> Linker -> Input -> Additional Depedencies:
libp3framework.lib
libpanda.lib
libpandafx.lib
libpandaexpress.lib
libp3dtool.lib
libp3dtoolconfig.lib
libp3pystub.lib
libp3direct.lib

Heres the error message now…

1>------ Rebuild All started: Project: Panda3D_test, Configuration: Release Win32 ------
1>Deleting intermediate and output files for project 'Panda3D_test', configuration 'Release|Win32'
1>Compiling...
1>main.cpp
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
1>        with
1>        [
1>            _Alloc=pallocator_array<std::string>
1>        ]
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
1>        d:\ohjelmat\panda3d\panda3d-1.6.2\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
1>        with
1>        [
1>            _Ty=std::string,
1>            _Ax=pallocator_array<std::string>
1>        ]
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
1>        with
1>        [
1>            _Alloc=pallocator_array<Config::SymbolEnt>
1>        ]
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
1>        d:\ohjelmat\panda3d\panda3d-1.6.2\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
1>        with
1>        [
1>            _Ty=Config::SymbolEnt,
1>            _Ax=pallocator_array<Config::SymbolEnt>
1>        ]
1>d:\ohjelmat\panda3d\panda3d-1.6.2\python\include\pyconfig.h(51) : warning C4005: 'HAVE_IO_H' : macro redefinition
1>        d:\ohjelmat\panda3d\panda3d-1.6.2\include\dtool_config.h(56) : see previous definition of 'HAVE_IO_H'
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
1>        with
1>        [
1>            _Alloc=pallocator_array<TypedWritable *>
1>        ]
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
1>        d:\ohjelmat\panda3d\panda3d-1.6.2\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
1>        with
1>        [
1>            _Ty=TypedWritable *,
1>            _Ax=pallocator_array<TypedWritable *>
1>        ]
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
1>        with
1>        [
1>            _Alloc=pallocator_array<int>
1>        ]
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
1>        d:\ohjelmat\panda3d\panda3d-1.6.2\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
1>        with
1>        [
1>            _Ty=int,
1>            _Ax=pallocator_array<int>
1>        ]
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\socket_address.h(182) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
1>        with
1>        [
1>            _Alloc=pallocator_array<unsigned char>
1>        ]
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
1>        d:\ohjelmat\panda3d\panda3d-1.6.2\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
1>        with
1>        [
1>            _Ty=unsigned char,
1>            _Ax=pallocator_array<unsigned char>
1>        ]
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_clock.h(195) : warning C4996: 'gmtime': This function or variable may be unsafe. Consider using gmtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(101) : see declaration of 'gmtime'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_clock.h(198) : warning C4996: 'gmtime': This function or variable may be unsafe. Consider using gmtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(101) : see declaration of 'gmtime'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_clock.h(212) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(114) : see declaration of 'localtime'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_clock.h(218) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(114) : see declaration of 'localtime'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_clock.h(250) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_clock.h(264) : warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(114) : see declaration of 'localtime'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_clock.h(298) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_clock.h(311) : warning C4996: 'gmtime': This function or variable may be unsafe. Consider using gmtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\time.inl(101) : see declaration of 'gmtime'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_span.h(372) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_span.h(375) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_span.h(378) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_span.h(381) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_span.h(384) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(366) : see declaration of 'sprintf'
1>d:\ohjelmat\panda3d\panda3d-1.6.2\include\time_general.h(161) : warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(324) : see declaration of 'sscanf'
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(439) : warning C4275: non dll-interface class 'std::_Container_base_aux' used as base for dll-interface class 'std::_Container_base_aux_alloc_real<_Alloc>'
1>        with
1>        [
1>            _Alloc=pallocator_array<GraphicsWindowInputDevice>
1>        ]
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility(377) : see declaration of 'std::_Container_base_aux'
1>        d:\ohjelmat\panda3d\panda3d-1.6.2\include\vector_src.h(64) : see reference to class template instantiation 'std::vector<_Ty,_Ax>' being compiled
1>        with
1>        [
1>            _Ty=GraphicsWindowInputDevice,
1>            _Ax=pallocator_array<GraphicsWindowInputDevice>
1>        ]
1>Linking...
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>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>main.obj : error LNK2001: unresolved external symbol "public: virtual class CycleData * __thiscall Geom::CDataCache::make_copy(void)const " (?make_copy@CDataCache@Geom@@$$FUBEPAVCycleData@@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall Geom::CDataCache::~CDataCache(void)" (??1CDataCache@Geom@@$$FUAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual class CycleData * __thiscall GeomVertexData::CDataCache::make_copy(void)const " (?make_copy@CDataCache@GeomVertexData@@$$FUBEPAVCycleData@@XZ)
1>main.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 GeomVertexData::CDataCache::_type_handle" (?_type_handle@CDataCache@GeomVertexData@@0VTypeHandle@@A)
1>C:\Users\sami\Desktop\Sekalaiset\Koodaus\Panda3D\Panda3D_test\Release\Panda3D_test.exe : fatal error LNK1120: 7 unresolved externals
1>Build log was saved at "file://c:\Users\sami\Desktop\Sekalaiset\Koodaus\Panda3D\Panda3D_test\Panda3D_test\Release\BuildLog.htm"
1>Panda3D_test - 8 error(s), 22 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Did you also remove NDEBUG from the defined symbols, as described in the manual?

You seem to be compiling against 1.6.2. Is this the version of the library you intend to be compiling against? Did you add this same version to the library path (and not 1.7.0)?

It’s probably best to have only one version of Panda3D installed at any given time, to avoid the risk of cross-contamination.

David

NDEBUG is removed from defined symbols. All include/bin/lib paths are set for 1.6.2 and version 1.7.0 Panda was completely removed before installing the 1.6.2 so Im only having one version installed at a time. So far, same error message.

I think I’ll try with 1.7.0 once more just to make sure I had all the settings correct even though it should work with 1.6.2 also.

I have used DirectX SDK, Esenthel Engine, etc. without problems so my compiler should be functioning just fine.

Thanks David for your effort to help! I appreciate it.

Hmm, I’m not sure, but it might also be related to a change in compiler version between 1.6.2 and 1.7.0. I know 1.7.0 is meant to be compiled with MSVS 2008; I’m not sure about 1.6.2.

Please let us know the results of your attempt with 1.7.0.

David

After installing 1.7.0 and re-downloading thirdparty files now I get this.

1>------ Build started: Project: Panda3D_test, Configuration: Release Win32 ------
1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'python25.lib'
1>Build log was saved at "file://c:\Users\sami\Desktop\Sekalaiset\Koodaus\Panda3D\Panda3D_test\Panda3D_test\Release\BuildLog.htm"
1>Panda3D_test - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I checked folder python/libs and theres only python26.lib and no python25.lib. Wrong version python? It’s the one that came with panda installer though.

Panda 1.7.0 ships with Python 2.6, though Python 1.6.2 used Python 2.5. Maybe you are using the wrong header files?

David

I double checked all the paths and they were correct.

Now that I created a completely new project and set up everything again, it compiles. With some warnings but it compiles and runs. Can’t really tell what was wrong with it but atleast it works.

So I basically did nothing new, but now it works. :slight_smile:

Big thanks to you David for helping me out.

I had the same issue with the pythoon26.lib file not being able to be opened. all it took was to change the directories from using python/Lib to python/libs and it works :slight_smile: