Команда сборки: G ++ Tests /*. /> G ++ версия: g ++ (ubuntu 13.3.0-6ubuntu2 ~ 24.04) 13.3.0 < /code>
catch2 версия: 3.4.0-1build1 < /code> < /p>
Код: Выделить всё
#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
Подробнее здесь: https://stackoverflow.com/questions/797 ... ompilation