Win32/makepanda.py compilation error

Hello,

I am getting this error compiling panda3d-1.7.0 on windows with makepanda.py. I’ve been using PTA(floats) around the shader system, so I believe I caused this problem, but I have no idea how, since on Linux with ppremake compile without any problem. Any idea on what could be the cause?

Thanks

Federico

Error      34           error LNK2005: "public: __thiscall PointerToArrayBase<float>::~PointerToArrayBase<float>(void)" (??1?$PointerToArrayBase@M@@QAE@XZ) already defined in pgraphnodes_composite1.obj            libpandaexpress.lib                makepanda

Error      35           error LNK2005: "public: __thiscall PointerToArray<float>::~PointerToArray<float>(void)" (??1?$PointerToArray@M@@QAE@XZ) already defined in pgraphnodes_composite1.obj      libpandaexpress.lib         makepanda

Error      36           error LNK2005: "public: static class PointerToArray<float> __cdecl PointerToArray<float>::empty_array(unsigned int,class TypeHandle)" (?empty_array@?$PointerToArray@M@@SA?AV1@IVTypeHandle@@@Z) already defined in pgraphnodes_composite1.obj  libpandaexpress.lib         makepanda

Error      37           error LNK2005: "public: __thiscall PointerToArray<float>::PointerToArray<float>(class TypeHandle)" (??0?$PointerToArray@M@@QAE@VTypeHandle@@@Z) already defined in pgraphnodes_composite1.obj                libpandaexpress.lib         makepanda

Error      38           error LNK2005: "public: __thiscall pvector<float>::~pvector<float>(void)" (??1?$pvector@M@@QAE@XZ) already defined in pgraphnodes_composite1.obj             libpandaexpress.lib         makepanda

Error      39           error LNK2005: "public: __thiscall pvector<float>::pvector<float>(unsigned int,class TypeHandle)" (??0?$pvector@M@@QAE@IVTypeHandle@@@Z) already defined in pgraphnodes_composite1.obj              libpandaexpress.lib                makepanda

Error      40           error LNK2005: "public: __thiscall pvector<float>::pvector<float>(class TypeHandle)" (??0?$pvector@M@@QAE@VTypeHandle@@@Z) already defined in pgraphnodes_composite1.obj               libpandaexpress.lib                makepanda

Error      41           error LNK2005: "public: void __thiscall std::vector<float,class pallocator_array<float> >::clear(void)" (?clear@?$vector@MV?$pallocator_array@M@@@std@@QAEXXZ) already defined in pgraphnodes_composite1.obj                libpandaexpress.lib         makepanda

Error      42           error LNK2005: "public: class std::_Vector_iterator<float,class pallocator_array<float> > __thiscall std::vector<float,class pallocator_array<float> >::end(void)" (?end@?$vector@MV?$pallocator_array@M@@@std@@QAE?AV?$_Vector_iterator@MV?$pallocator_array@M@@@2@XZ) already defined in pgraphnodes_composite1.obj              libpandaexpress.lib         makepanda

Error      43           error LNK2005: "public: class std::_Vector_iterator<float,class pallocator_array<float> > __thiscall std::vector<float,class pallocator_array<float> >::begin(void)" (?begin@?$vector@MV?$pallocator_array@M@@@std@@QAE?AV?$_Vector_iterator@MV?$pallocator_array@M@@@2@XZ) already defined in pgraphnodes_composite1.obj              libpandaexpress.lib         makepanda

Error      44           error LNK2005: "public: __thiscall PointerToArrayBase<float>::~PointerToArrayBase<float>(void)" (??1?$PointerToArrayBase@M@@QAE@XZ) already defined in pgraphnodes_composite1.obj            libpandaexpress.lib                makepanda

Error      45           error LNK2005: "public: __thiscall PointerToArray<float>::~PointerToArray<float>(void)" (??1?$PointerToArray@M@@QAE@XZ) already defined in pgraphnodes_composite1.obj      libpandaexpress.lib         makepanda

Error      46           error LNK2005: "public: static class PointerToArray<float> __cdecl PointerToArray<float>::empty_array(unsigned int,class TypeHandle)" (?empty_array@?$PointerToArray@M@@SA?AV1@IVTypeHandle@@@Z) already defined in pgraphnodes_composite1.obj  libpandaexpress.lib         makepanda

Error      47           error LNK2005: "public: __thiscall PointerToArray<float>::PointerToArray<float>(class TypeHandle)" (??0?$PointerToArray@M@@QAE@VTypeHandle@@@Z) already defined in pgraphnodes_composite1.obj                libpandaexpress.lib         makepanda

Error      48           error LNK2005: "public: __thiscall pvector<float>::~pvector<float>(void)" (??1?$pvector@M@@QAE@XZ) already defined in pgraphnodes_composite1.obj             libpandaexpress.lib         makepanda

Error      49           error LNK2005: "public: __thiscall pvector<float>::pvector<float>(unsigned int,class TypeHandle)" (??0?$pvector@M@@QAE@IVTypeHandle@@@Z) already defined in pgraphnodes_composite1.obj              libpandaexpress.lib                makepanda

Error      50           error LNK2005: "public: __thiscall pvector<float>::pvector<float>(class TypeHandle)" (??0?$pvector@M@@QAE@VTypeHandle@@@Z) already defined in pgraphnodes_composite1.obj               libpandaexpress.lib                makepanda

Error      51           error LNK2005: "public: void __thiscall std::vector<float,class pallocator_array<float> >::clear(void)" (?clear@?$vector@MV?$pallocator_array@M@@@std@@QAEXXZ) already defined in pgraphnodes_composite1.obj                libpandaexpress.lib         makepanda

Error      52           error LNK2005: "public: class std::_Vector_iterator<float,class pallocator_array<float> > __thiscall std::vector<float,class pallocator_array<float> >::end(void)" (?end@?$vector@MV?$pallocator_array@M@@@std@@QAE?AV?$_Vector_iterator@MV?$pallocator_array@M@@@2@XZ) already defined in pgraphnodes_composite1.obj              libpandaexpress.lib         makepanda

Error      53           error LNK2005: "public: class std::_Vector_iterator<float,class pallocator_array<float> > __thiscall std::vector<float,class pallocator_array<float> >::begin(void)" (?begin@?$vector@MV?$pallocator_array@M@@@std@@QAE?AV?$_Vector_iterator@MV?$pallocator_array@M@@@2@XZ) already defined in pgraphnodes_composite1.obj              libpandaexpress.lib         makepanda

Error      54           fatal error LNK1169: one or more multiply defined symbols found            built/bin/libpanda.dll     makepanda

This is why we developed the PTA_float typedef. Windows is strangely fussy about multiple instantiations of the same template, so by using that typedef, we insist on always using the same instatiation.

Try replacing PTA(float) with PTA_float, and be sure you #include “pta_float.h” where it is needed.

Another reason I’m not a big fan of C++ templates. :slight_smile:

David

Thanks David. :slight_smile: