Error when linking against libpanda.lib

I am building a module in C that talks to the global event handler in pandac. Currently my project is linking against these static import libraries: libpanda.lib libpandaexpress.lib libframework.lib libdtool.lib

In my code I include EventHandler.h and EventQueue.h. To get the global event handler I am doing:


EventHandler *eh = EventHandler::get_global_event_handler(EventQueue::get_global_event_queue()))

Im getting the following link errors:

EventTest.obj : error LNK2001: unresolved external symbol "protected: static class EventHandler * EventHandler::_global_event_handler" (?_global_event_handler@EventHandler@@1PAV1@A)
EventTest.obj : error LNK2001: unresolved external symbol "public: static class EventQueue * EventQueue::_global_event_queue" (?_global_event_queue@EventQueue@@2PAV1@A)

At first I thought it was some wierdness with an inline function accessing a private static member so I took out the inline directives and recompiled panda. Alas no luck… so I make the members public and that still didn’t fix it. Anyone know what is going on here? Am I going about this completely wrong? Any input would be greatly appreciated.

Try #defining the symbol WIN32_VC before you include any Panda code (or put that symbol in your project to be defined globally). You might need to define WIN32, too–I’m not sure if this one is defined automatically or not.

The Panda header files need these symbols defined to tell them that you are compiling on a Windows system, using Microsoft Visual C++. In the presence of WIN32_VC, they will insert the appropriate __declspec(dllimport) statements on the class definition that Microsoft requires in order to import a class from a DLL.

David

woot once again you are the man david