-
Linking...
Creating library Debug/Map Editor.lib and object Debug/Map Editor.exp
LINK : warning LNK4049: locally defined symbol ""public: __thiscall debug::exception::exception(void)" (??0exception@debug@@QAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual __thiscall debug::exception::~exception(void)" (??1exception@debug@@UAE@XZ)" imported
LINK : warning LNK4049: locally defined symbol ""protected: static unsigned int debug::exception::instances" (?instances@exception@debug@@1IA)" imported
LINK : warning LNK4049: locally defined symbol ""public: __thiscall debug::exception::exception(class exception::exception const &)" (??0exception@debug@@QAE@ABV01@@Z)" imported
Odd static library problem...
I decided to create a static lib for my exception class, just out of fun (so don''t argue with me, ok?).
It''s just a simple Win32 static library with 1 .cpp file and 1 .hpp file. The .hpp file declares my exception class using __declspec(dllexport) so that it is exported, and the .cpp file contains mostly empty function definitions. The exception class itself contains one pure virtual function, output().
Now, the static library builds properly and all is good until I go to use it in my map editor. I added the .lib file to my project, copied the header and changed the dllexport to dllimport. I also included the .hpp file in the two files which use it.
Here are the linker errors from my map editor executable:
June 09, 2000 04:48 PM
This may be stupid on my part, but did you include in your header files something along the lines of:
#ifndef HEADER_H
#define HEADER_H
//Put header info here
#endif
#ifndef HEADER_H
#define HEADER_H
//Put header info here
#endif
Unless I''m missing something big, why would you use dllexport at all? This is a static library, not a dll.
Rock
Rock
Yeah, a static library is really just a bunch of object files combined.. So all you have to do is declare stuff as local (not imported) and link in the library, and it should work like it''s part of the code from the program you''re using it with.
Doh!
I haven''t been online for a while now, so thanks for your help!
- null_pointer
Sabre Multimedia
I haven''t been online for a while now, so thanks for your help!
- null_pointer
Sabre Multimedia
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement