Problem was solved by converting the shared libraries into static ones and extracting the necessary parts into a shared library, without keeping the circularity.
CMake linking error on windows
Question
I have an annoying CMake issue. I have a project with more than one directories, such as (theoretically):
- compiler -> generates compiler.exe and compiler.dll
- This is pure C++
- However the compiler.dll needs to link to machine.dll (see below) due to use of some fancy things ...
- and the compiler.dll is a SHARED library
- machine -> generates machine.exe and machine.dll -
- this is half C and half C++. The C++ part needs to link to compiler.dll
So here a circular dependency arose, which is very elegantly solved on Linux, however on MSVS2012, the linker complains with LNK2019 ... unresolved external symbol. Which is understandable, since when I see the compilation, the order is the following:
- it compiles the machine's C files
- it tries to compile the machine's C++ files ... and here it fails at the linking, since the compilers' C++ files were not compiled yet...
How can I resolve this issue?
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow