stefanseefeld / faber

Faber
https://stefanseefeld.github.io/faber
Boost Software License 1.0
14 stars 2 forks source link

MSVC test failure in examples/implicit_rules/ #12

Closed stefanseefeld closed 5 years ago

stefanseefeld commented 5 years ago

Appveyor reports a test failure when running faber inside the examples/implicit_rules directory. This examples builds two binaries (hello1 and hello2), from the same sources, but once with a static lib, and once with a shared lib. It's the shared library link that fails with

error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl greet(void)" (__imp_?greet@@YAXXZ) referenced in function main"

Apparently this may be caused by incompatible compiler or linker flags being used in the compile and link steps.

The exact command-lines can be seen by running faber --log=actions --log=commands.

stefanseefeld commented 5 years ago

The issue was caused by the two intermediate hello.o object files overwriting each other, so depending on the order they are compiled in, linking hello1 would fail. The solution is to force hello1 and hello2 to use distinct (non-incidental) feature sets so they don't collide.