[Windows] C++ issue, MSVC 2008

I’ve been recently getting some errors when trying to compile a code in Microsoft Visual Studio 2008 using C++. I’m getting 79 errors! And using DirectX 9.0

Here is the code: http://www.panda3d.org/manual/index.php/Starting_Panda3D

And these are the first lines of the Output windows.

 Compiling...
main.cpp
c:\panda3d-1.6.2\include\parser-inc\iostream(32) : error C2059: syntax error : 'enum [tag]'
c:\panda3d-1.6.2\include\parser-inc\iostream(32) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
c:\panda3d-1.6.2\include\parser-inc\iostream(42) : error C2062: type 'long' unexpected
c:\panda3d-1.6.2\include\parser-inc\iostream(42) : error C2238: unexpected token(s) preceding ';'
c:\panda3d-1.6.2\include\parser-inc\iostream(54) : error C2062: type 'void' unexpected
c:\panda3d-1.6.2\include\parser-inc\iostream(54) : error C2238: unexpected token(s) preceding ';'
c:\panda3d-1.6.2\include\parser-inc\iostream(56) : error C2249: 'ios::streampos' : no accessible path to private typedef declared in virtual base 'ios'
        c:\panda3d-1.6.2\include\parser-inc\iostream(43) : see declaration of 'ios::streampos'
        c:\panda3d-1.6.2\include\parser-inc\iostream(40) : see declaration of 'ios'
c:\panda3d-1.6.2\include\parser-inc\iostream(57) : error C2249: 'ios::streampos' : no accessible path to private typedef declared in virtual base 'ios'
        c:\panda3d-1.6.2\include\parser-inc\iostream(43) : see declaration of 'ios::streampos'
        c:\panda3d-1.6.2\include\parser-inc\iostream(40) : see declaration of 'ios'
c:\panda3d-1.6.2\include\parser-inc\iostream(58) : error C2249: 'ios::streamoff' : no accessible path to private typedef declared in virtual base 'ios'
        c:\panda3d-1.6.2\include\parser-inc\iostream(44) : see declaration of 'ios::streamoff'
        c:\panda3d-1.6.2\include\parser-inc\iostream(40) : see declaration of 'ios'
c:\panda3d-1.6.2\include\parser-inc\iostream(58) : error C2039: 'seekdir' : is not a member of 'ios_base'
        c:\panda3d-1.6.2\include\parser-inc\iostream(30) : see declaration of 'ios_base'
c:\panda3d-1.6.2\include\parser-inc\iostream(58) : error C2061: syntax error : identifier 'seekdir'
c:\panda3d-1.6.2\include\parser-inc\iostream(62) : error C2062: type 'int' unexpected
c:\panda3d-1.6.2\include\parser-inc\iostream(62) : error C2238: unexpected token(s) preceding ';'
 

Please, help me, because I really needs to begin learning how to use Panda3D.

Cya’

I’ve been reading this post https://discourse.panda3d.org/viewtopic.php?t=6425, but it didn’t help me… :confused:

It looks like you somehow put the parser-inc folder on your INCLUDE path. Take it out, it doesn’t belong.

David

Do I need to use only these two includes?

C:\Panda3D-1.6.2\include
C:\Panda3D-1.6.2\python\include

Yeah, that looks right.

But I added only that two and the errors continues appearing. :angry:

Are you sure those are the same errors? The errors above sure look like there are files included from parser-inc, while that shouldn’t be. Try temporarily renaming c:\panda3d-1.6.2\include\parser-inc\ to something different to be certain that this is the issue.

New message error:

Linking...
LINK : fatal error LNK1104: cannot open file 'python25.lib'

With the parser-inc renamed and not remaned I get the same error. :angry:

Okay, this means it got one step futher.
python25.lib is located in C:\Panda3D-1.6.2\libs so try adding that to your library path.
Dunno why you need to link to Python at all, though, try to link to pystub instead.

Ok, linked to the …/libs directory, and now I receive this weird error:

11 error(s), 22 warning(s)

Linking...
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall PandaFramework::close_framework(void)" (__imp_?close_framework@PandaFramework@@QAEXXZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall PandaFramework::main_loop(void)" (__imp_?main_loop@PandaFramework@@QAEXXZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class WindowFramework * __thiscall PandaFramework::open_window(void)" (__imp_?open_window@PandaFramework@@QAEPAVWindowFramework@@XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall PandaFramework::set_window_title(class std::basic_string,class std::allocator > const &)" (__imp_?set_window_title@PandaFramework@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall PandaFramework::open_framework(int &,char * * &)" (__imp_?open_framework@PandaFramework@@QAEXAAHAAPAPAD@Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class BitMask __cdecl BitMask::lower_on(int)" (__imp_?lower_on@?$BitMask@I$0CA@@@SA?AV1@H@Z) referenced in function "void __cdecl `dynamic initializer for 'default_collision_node_collide_mask''(void)" (??__Edefault_collision_node_collide_mask@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class BitMask __cdecl BitMask::bit(int)" (__imp_?bit@?$BitMask@I$0CA@@@SA?AV1@H@Z) referenced in function "void __cdecl `dynamic initializer for 'default_geom_node_collide_mask''(void)" (??__Edefault_geom_node_collide_mask@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall PandaFramework::PandaFramework(void)" (__imp_??0PandaFramework@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'framework''(void)" (??__Eframework@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall BitMask::~BitMask(void)" (__imp_??1?$BitMask@I$0CA@@@QAE@XZ) referenced in function "void __cdecl `dynamic atexit destructor for 'default_collision_node_collide_mask''(void)" (??__Fdefault_collision_node_collide_mask@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall PandaFramework::~PandaFramework(void)" (__imp_??1PandaFramework@@UAE@XZ) referenced in function "void __cdecl `dynamic atexit destructor for 'framework''(void)" (??__Fframework@@YAXXZ)
C:\Users\Paradox\Documents\Visual Studio 2008\Projects\teste com o panda\Release\teste com o panda.exe : fatal error LNK1120: 10 unresolved externals
 Results