Open p4vook opened 11 months ago
Could be related to #2728
Catch2Main
depends on Catch2
. IIRC for bfd link order matters, so try that first.
Same errors are produced even if I don't link to Catch2Main
, so I assume it's not relevant.
The problem is the Catch2
must also be built with libc++
. So you likely need to build it from source.
The problem is the
Catch2
must also be built withlibc++
. So you likely need to build it from source.
This is what I think may be happening as well.
Hmm, is it possible to fix this?
Anyway, I think it should be mentioned somewhere in the documentation that Catch relies somewhat heavily on the standard library ABI. I couldn't find this mention anywhere, but I could've missed it though.
Hmm, is it possible to fix this?
Sure it is. Compile Catch2 with libc++ and I expect it'd work.
I think it should be mentioned somewhere in the documentation that Catch relies somewhat heavily on the standard library ABI.
Pretty much all C++ libraries are susceptible to this. It's just one of those things you have to deal with when trying to use a non-default standard library for your given OS. I think it's outside the scope of Catch2's documentation to cover this.
Describe the bug When trying to compile any Catch2 v3 test case with libcxx as stdlib, multiple linker errors pop up.
Expected behavior I expected to be able to use libcxx as a drop-in replacement for libstdc++.
Reproduction steps Consider this testcase:
Compile it with clang++, using libcxx as stdlib:
clang++ -stdlib=libc++ -lCatch2 -lCatch2Main test.cpp
Get following errors:
Platform information:
libcxx
version 17.0.5,Catch2
version 3.4.0 (Gentoo enables-DCATCH_DEVELOPMENT_BUILD=ON
if that could be important).