C++ EggLoader linker error

I can’t seem to use the EggLoader class in my c++ code. I always get a linker error, even though I do include the libpandaegg.lib library.

I’m 99% sure that that’s the correct library… At least when i do a “find in files” text search on the Panda3d\libs directory for “EggLoader” it’s the only file that contains a reference to EggLoader.

Furthermore, i’ve tried to include pretty much every libegg file with no luck. (and just to be sure… I actually once tried to include ALL the panda libs :slight_smile: )

Error 1 error LNK2001: unresolved external symbol “public: __thiscall EggLoader::EggLoader(void)” (??0EggLoader@@QAE@XZ) BMLR_Panda.obj

or… if I try to use the EggData constructor:

Error 252 error LNK2001: unresolved external symbol “public: __thiscall EggLoader::EggLoader(class EggData const *)” (??0EggLoader@@QAE@PBVEggData@@@Z) BMLR_Panda.obj

I’m using Visual Studio 2005 and everything else works fine but EggLoader… I’m loading in models and animating them fine, etc… But eggloader doesn’t seem to work.

This is how I’m using it:

EggLoader loader = EggLoader();

or

EggData* data = new EggData();
EggLoader loader = EggLoader(data);

with the obligatory #include <eggLoader.h> at top ofcourse.

Ps. I’ve tried to use the libs I built myself from the panda code and I get the same error.

Hmm. Both EggData and EggLoader, as well as all of the egg stuff, are defined in libpandaegg.lib/dll. This is all you need to link with, and it works fine for me. (And, I think this should be the only libegg file there is, at least on Windows. Are you seeing more than this?)

In fact, if you are able to run “pview smiley.egg” and see smiley, then it has worked for pview too. How is pview building differently from your own application?

But note that you don’t normally need to directly call the egg loader, unless you really want to examine the internal egg structures directly. The egg data is normally not examined, but is converted (via the loader) into a hierarchy of nodes representing a model.

David