|
Boost : |
Subject: Re: [boost] Clang on Windows
From: degski (degski_at_[hidden])
Date: 2018-03-16 11:19:37
On 15 March 2018 at 13:30, Marcel Raad via Boost <boost_at_[hidden]>
wrote:
> > -----Original Message-----
> > From: Boost <boost-bounces_at_[hidden]> On Behalf Of Paul A. Bristow
> > via Boost
> > Sent: Donnerstag, 15. März 2018 19:05
> > To: boost_at_[hidden]
> > Cc: Paul A. Bristow <pbristow_at_[hidden]>
> > 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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk