I have a small project running on Linux and Mac and I'm now porting it to Windows (Vista). Qt version is 4.7. I'm using VSE 2008 for an IDE.
I did have one small sample working a couple of months ago so I know my environment is set up correctly.
I've been able to easily/quickly resolve most of the issues with just some .pro file tweaking, but I can't resolve this last one (last problem, ha!).
The program structure consists of multiple subdirectories and each subdir creates a shared library of the associated object files (e.g., .so on linux, .dylib on mac, .dll on Win32).
However, when I link a subdirectory of object files into a DLL on windows and code in that directory references classes/functions in another (unbuilt) library, I get 'error LNK2019: unresolved external symbol...'
The .pro file in each subdirectory basically has 'CONFIG += shared' in it (included in a common file, actually).
Each subdirectory also defines their own namespace.
The link line generated to link a DLL looks like:
link /LIBPATH:"c:\Programs\Qt\4.7.0\lib" /NOLOGO /DEBUG /DLL /MANIFEST /MANIFESTFILE:"../../build/element\element.intermediate.manifest" /OUT:..\..\lib\element.dll @C:\XXXXX\AppData\Local\Temp\nmDF6C.tmp
link /LIBPATH:"c:\Programs\Qt\4.7.0\lib" /NOLOGO /DEBUG /DLL /MANIFEST /MANIFESTFILE:"../../build/element\element.intermediate.manifest" /OUT:..\..\lib\element.dll @C:\XXXXX\AppData\Local\Temp\nmDF6C.tmp
To copy to clipboard, switch view to plain text mode
The 'nmDF6C.tmp' file is deleted at the end of the build command so I can't see what it contains.
The errors:
Element.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall exceptions::DuplicateException::~DuplicateException(void)" (??1DuplicateException@exceptions@@UAE@XZ) referenced in function "protected: void __thiscall element::Element::add(class core::DataChannel *)" (?add@Element@element@@IAEXPAVDataChannel@core@3456@@Z)
Element.obj : error LNK2019: unresolved external symbol "public: __thiscall exceptions::DuplicateException::DuplicateException(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0DuplicateException@exceptions@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "protected: void __thiscall element::Element::add(class core::DataChannel *)" (?add@Element@element@@IAEXPAVDataChannel@core@3456@@Z)
Element.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall exceptions::DuplicateException::~DuplicateException(void)" (??1DuplicateException@exceptions@@UAE@XZ) referenced in function "protected: void __thiscall element::Element::add(class core::DataChannel *)" (?add@Element@element@@IAEXPAVDataChannel@core@3456@@Z)
Element.obj : error LNK2019: unresolved external symbol "public: __thiscall exceptions::DuplicateException::DuplicateException(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0DuplicateException@exceptions@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "protected: void __thiscall element::Element::add(class core::DataChannel *)" (?add@Element@element@@IAEXPAVDataChannel@core@3456@@Z)
To copy to clipboard, switch view to plain text mode
I'm a rather newbie on developing C++ apps on Windows (I spend most of my time on Linux/Mac)... Do I need some sort of '__declspec()' foo on the function definitions or declarations or?
Thanks.
Bookmarks