LNK2019 and LNK1120 errors on Windows

I’ve been trying to build Panda3D 1.6.1, unmodified, on my windows Vista and I get these errors when I try to build with VS9.
What to do.

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:\panda3d\panda3d-1.6.1-win32\panda3d-1.6.1\debug\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>debug/bin/interrogate_module  -oc debug/tmp/libpandaegg_module.cxx -module pandaegg -library libpandaegg -python-native  debug/pandac/input/libegg2pg.in debug/pandac/input/libegg.in
1>Referencing Library libegg
1>Referencing Library libegg2pg
1>cl /wd4996 /Fodebug/tmp/libpandaegg_module.obj /nologo /c  /Ipanda/metalibs/pandaegg /Ipanda/src/egg /I"thirdparty/win-python/include" /I"debug/tmp" /I"debug/include" /MD /Zi /RTCs /GS /Fddebug/tmp/libpandaegg_module.pdb /DBUILDING_PANDAEGG /EHsc /Zm300 /DWIN32_VC /DWIN32 /W3 debug/tmp/libpandaegg_module.cxx
1>libpandaegg_module.cxx
1>d:\panda3d\panda3d-1.6.1-win32\panda3d-1.6.1\thirdparty\win-python\include\pyconfig.h(51) : warning C4005: 'HAVE_IO_H' : macro redefinition
1>        d:\panda3d\panda3d-1.6.1-win32\panda3d-1.6.1\debug\include\dtool_config.h(56) : see previous definition of 'HAVE_IO_H'
1>link /nologo /NOD:MFC80.LIB /NOD:MFC90.LIB /NOD:LIBCI.LIB /NOD:MSVCRTD.LIB /DEBUG  /nod:libc /nod:libcmtd /nod:atlthunk /DLL /MAP /MAPINFO:EXPORTS /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO  /OUT:debug/bin/libpandaegg.dll /IMPLIB:debug/lib/libpandaegg.lib /LIBPATH:"thirdparty/win-python/libs" debug/tmp/pandaegg_pandaegg.obj debug/tmp/libpandaegg_module.obj debug/tmp/egg2pg_composite.obj debug/tmp/libegg2pg_igate.obj debug/tmp/egg_composite1.obj debug/tmp/egg_composite2.obj debug/tmp/egg_parser.obj debug/tmp/egg_lexer.obj debug/tmp/libegg_igate.obj debug/lib/libpanda.lib debug/lib/libpandaexpress.lib debug/lib/libp3dtool.lib debug/lib/libp3dtoolconfig.lib advapi32.lib
1>   Creating library debug/lib/libpandaegg.lib and object debug/lib/libpandaegg.exp
1>libegg2pg_igate.obj : warning LNK4049: locally defined symbol ?Dtool_EggData@@3UDtool_PyTypedObject@@A (struct Dtool_PyTypedObject Dtool_EggData) imported
1>mt -manifest debug/bin/libpandaegg.dll.manifest -outputresource:debug/bin/libpandaegg.dll;2
1>Microsoft (R) Manifest Tool version 5.2.3790.2075
1>Copyright (c) Microsoft Corporation 2005. 
1>All rights reserved.
1>link /nologo /NOD:MFC80.LIB /NOD:MFC90.LIB /NOD:LIBCI.LIB /NOD:MSVCRTD.LIB /DEBUG  /nod:libc /nod:libcmtd /nod:atlthunk /DLL /MAP /MAPINFO:EXPORTS /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO  /OUT:debug/bin/libpandastripped.dll /IMPLIB:debug/lib/libpandastripped.lib /LIBPATH:"thirdparty/win-python/libs" debug/tmp/pipeline_composite.obj debug/tmp/event_composite.obj debug/tmp/net_composite.obj debug/tmp/nativenet_composite.obj debug/tmp/pstatclient_composite.obj debug/tmp/linmath_composite.obj debug/tmp/mathutil_composite.obj debug/tmp/putil_composite1.obj debug/tmp/putil_composite2.obj debug/tmp/pnmimagetypes_composite.obj debug/tmp/pnmimage_composite.obj debug/tmp/pandabase_pandabase.obj debug/lib/libpandaexpress.lib debug/lib/libp3dtoolconfig.lib debug/lib/libp3dtool.lib wsock32.lib ws2_32.lib user32.lib winmm.lib advapi32.lib thirdparty/win-libs-vc9/png/lib/libpandapng.lib thirdparty/win-libs-vc9/jpeg/lib/libpandajpeg.lib thirdparty/win-libs-vc9/tiff/lib/libpandatiff.lib thirdparty/win-libs-vc9/zlib/lib/libpandazlib1.lib thirdparty/win-libs-vc9/openssl/lib/libpandassl.lib thirdparty/win-libs-vc9/openssl/lib/libpandaeay.lib thirdparty/win-libs-vc9/fftw/lib/rfftw.lib thirdparty/win-libs-vc9/fftw/lib/fftw.lib
1>   Creating library debug/lib/libpandastripped.lib and object debug/lib/libpandastripped.exp
1>pipeline_composite.obj : error LNK2019: unresolved external symbol _init_thread_context referenced in function "public: bool __thiscall ThreadSimpleImpl::start(enum ThreadPriority,bool)" (?start@ThreadSimpleImpl@@QAE_NW4ThreadPriority@@_N@Z)
1>pipeline_composite.obj : error LNK2019: unresolved external symbol _save_thread_context referenced in function "public: void __thiscall ThreadSimpleManager::next_context(void)" (?next_context@ThreadSimpleManager@@QAEXXZ)
1>pipeline_composite.obj : error LNK2019: unresolved external symbol _switch_to_thread_context referenced in function "private: void __thiscall ThreadSimpleManager::choose_next_context(void)" (?choose_next_context@ThreadSimpleManager@@AAEXXZ)
1>debug/bin/libpandastripped.dll : fatal error LNK1120: 3 unresolved externals
1>Storing dependency cache.
1>Elapsed Time: 28 min 12 sec
1>Build log was saved at "file://d:\panda3d\panda3d-1.6.1-win32\panda3d-1.6.1\debug\BuildLog.htm"
1>makepanda - 4 error(s), 1097 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Using already built libraries is out of questions because I need to rewrite the display interface so that I can make Panda3D work on the browser without creating a new independent window.

Also, I believe I can build the display interface alone and use the other .dlls and .sos intact, should this be the route I take instead of building the entire application from scratch?

Seems like a weird issue with threading. I ran into it in the past, but I don’t know if the 1.6.1 source is affected with the same issue.
Anyways, I’m about to release 1.6.2. You could try it with the 1.6.2 source.
panda3d.org/download/panda3d … -win32.zip
(You’ll probably need to add --version 1.6.1 to the options if you want it to be compatible with other libs)

But yeah, the display module is loaded dynamically, so you can compile it without recompiling Panda entirely.

If pro-rsoft is right just run the compiler only on one core. Or you can disable one core entirely to make be 100% secure that the process will finish right.

In vista there are several ways how to do that. Just google it.

btw pro-rsoft:

I am not finished with converting my projects to 1.6.1 and you are already done with 1.6.2? [size=0]ROFL[/size] if some projects, I won’t better mention here, would be done that fast, I’d not need things like blender, gimp or windows.

It’s possible that this is the issue MentalDisaster referred to, but very unlikely - since it doesn’t look like you compiled with “–threads 2” (or so) enabled.

@MentalDisaster: 1.6.2 should be entirely backward compatible with 1.6.1. It only fixes some important bugs.

Didn’t know. I continue converting then.

Thank you all for your input. I think I will just re-build the display module alone and leave all the other bits intact unless…

@pro-rsoft
WOW, 1.6.2 out already. Do you ever sleep? :slight_smile: