Reputation: 6351
I am converting an application to use .dlls and I'm riddled with linker errors stating
unersolved external symbol"__declspec(dllimport) public: void __thiscall Rail::SetNextrail(class Rail *)"
There is more gibberish at the end of this error message. Why should this happen and how do you fix it? __declspec(dllimport) is being placed with a macro defined as:
#ifdef LUDOAI_EXPORT
#define DECLSPECAI __declspec(dllexport)
#else
#define DECLSPECAI __declspec(dllimport)
#endif
Upvotes: 1
Views: 4968
Reputation: 1
I would just like to add, if you are using Qt Creator, this error means you need to add the appropriate import library to your project (.pro) file.
For example:
LIBS += $$quote(C:/Qt/4.7.3/lib/QtXml4.lib)
for debug and release versions.
Upvotes: 0
Reputation: 19467
I believe what you need to do is specify the Rails "import library" to the linker. Using the GUI, this is on the linker tab of project settings, under "additional libraries."
The "import library" is a .LIB file which contains symbols that resolve to the imports of the corresponding library. In the symbols from the .LIB file is an unconditional jump to the imports table's corresponding address for the import. When your code calls an import, it really calls this stub in the import library, which jumps to the import.
Upvotes: 2