On 15 March 2018 at 13:30, Marcel Raad via Boost
-----Original Message----- From: Boost
On Behalf Of Paul A. Bristow via Boost Sent: Donnerstag, 15. März 2018 19:05 To: boost@lists.boost.org Cc: Paul A. Bristow Subject: Re: [boost] Clang on Windows I have got some things to work, but linking libraries produces an inexplicable (to me) link failure when trying to use Boost.Test and Clang.
I have tried this on Codeblocks when I can link to Chrono library OK, but when I try to use Boost.Test using the same test.cpp that passes using GCC7.1.0, I get a final failure
LINK : fatal error LNK1561: entry point must be defined
There is not a int main() but Boost.Test's own entry function
int unit_test_main( init_unit_test_func init_func, int argc, char* argv[] );
that I presume should be fed in place of int main()
Is this a Boost.Test config problem that makes Clang and GCC different , or am I doing something silly.
I've seen this error when /SUBSYSTEM:CONSOLE wasn't passed to the MSVC linker.
If you'd do that, you'll have an issue, but... I've just tested building an app not passing /SUBSYSTEM:CONSOLE. It builds and runs, but of course there's no console window (something flashes up, no error or problem). I think the -flto=thin flag is possibly not properly passed around, or the vc linker (link.exe) is invoked instead of lld.exe. As OP's libs are lto instrumented, they can only be linked with lld and the flag -flto=thin. degski