Re: Help with catch2 transition needed
On 2023-11-07, Andreas Tille <andreas@an3as.eu> wrote:
> I noticed that catch2 does not contain the header file catch.hpp any
> more. There is now some catch_all.hpp. So I replaced this header file
> in a patch[1] but obviously this problem can't be solved by pure wild
> guessing since this has lead to
>
> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
> (.text+0x17): undefined reference to `main'
in catch2 3.0 and later you now need to link catch2 and catch2 main in
your tests.
try link with Catch2WithMain in your test targets
Like this:
target_link_libraries(test PRIVATE Catch2::Catch2WithMain)
/Sune
Reply to: