У меня есть приведенный ниже код Catch2 V3, но я получаю ошибку линкера < /p>
Команда сборки: G ++ Tests /*. /> G ++ версия: g ++ (ubuntu 13.3.0-6ubuntu2 ~ 24.04) 13.3.0 < /code>
#include
#include
#define CATCH_CONFIG_MAIN
uint32_t factorial( uint32_t number ) {
return number
Сообщение об ошибке < /h4>
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/libCatch2Main.a(catch_main.cpp.o): in function `main.cold':
(.text.unlikely+0x4): undefined reference to `Catch::Session::~Session()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/libCatch2Main.a(catch_main.cpp.o): in function `main':
(.text.startup+0x3b): undefined reference to `Catch::Session::Session()'
/usr/bin/ld: (.text.startup+0x49): undefined reference to `Catch::Session::~Session()'
/usr/bin/ld: (.text.startup+0x78): undefined reference to `Catch::Session::applyCommandLine(int, char const* const*)'
/usr/bin/ld: (.text.startup+0x86): undefined reference to `Catch::Session::run()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/libCatch2Main.a(catch_main.cpp.o): in function `_GLOBAL__sub_I_main':
(.text.startup+0xb8): undefined reference to `Catch::LeakDetector::LeakDetector()'
/usr/bin/ld: (.text.startup+0xbf): undefined reference to `Catch::LeakDetector::~LeakDetector()'
collect2: error: ld returned 1 exit status
У меня есть приведенный ниже код Catch2 V3, но я получаю ошибку линкера < /p> Команда сборки: G ++ Tests /*. /> G ++ версия: g ++ (ubuntu 13.3.0-6ubuntu2 ~ 24.04) 13.3.0 < /code>
uint32_t factorial( uint32_t number ) { return number Сообщение об ошибке < /h4> /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/libCatch2Main.a(catch_main.cpp.o): in function `main.cold': (.text.unlikely+0x4): undefined reference to `Catch::Session::~Session()' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/libCatch2Main.a(catch_main.cpp.o): in function `main': (.text.startup+0x3b): undefined reference to `Catch::Session::Session()' /usr/bin/ld: (.text.startup+0x49): undefined reference to `Catch::Session::~Session()' /usr/bin/ld: (.text.startup+0x78): undefined reference to `Catch::Session::applyCommandLine(int, char const* const*)' /usr/bin/ld: (.text.startup+0x86): undefined reference to `Catch::Session::run()' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/libCatch2Main.a(catch_main.cpp.o): in function `_GLOBAL__sub_I_main': (.text.startup+0xb8): undefined reference to `Catch::LeakDetector::LeakDetector()' /usr/bin/ld: (.text.startup+0xbf): undefined reference to `Catch::LeakDetector::~LeakDetector()' collect2: error: ld returned 1 exit status [/code] Что я делаю не так и как исправить?
У меня есть проект на C++, который я компилирую в WebAssembly через Emscripten. Я хотел бы использовать Catch2 для запуска тестов, но я заметил, что при сбое теста вместо завершения набора тестов с журналом того, какие тесты не прошли, сам...