KOLFLIB_EXPORT Macro causes many linking errors when compiling with craft on windows using mingw and MSVC
Details
Diff Detail
- Repository
- R407 Kolf
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 17635 Build 17653: arc lint + arc unit
This will probably also break msvc.
I’d suggest reading the doc of cmake generate export macros.
The macros are often used wrong...
Instead of removing KOLFLIB_EXPORT, set a define when building it so it choses the correct dll linkage.
Make the library STATIC instead of SHARED in the cmakelists.txt . It was having different problems where it couldn't find things that were in the library when linking:
Creating library lib\kolf.lib and object lib\kolf.exp main.cpp.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const KolfGame::staticMetaObject" (?staticMetaObject@KolfGame@@2UQMetaObject@@B) main.cpp.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const KolfWindow::staticMetaObject" (?staticMetaObject@KolfWindow@@2UQMetaObject@@B) bin\kolf.exe : fatal error LNK1120: 2 unresolved externals
If we're going to make the kolfprivate library to be static, which kind of makes sense since we don't install the includes anyway
I think you should remove the exporting altogether since it isn't needed at all anymore then.
Do you have some developer account to push that yourself? If not, I would go for applying for one, as you seem to care for this stuff and it will be much easier if you can push on your own.