Tobias Dick
06/20/2022 7:33 AM
post121829
|
Hello,
i have trouble with linking gtest. When i work from command line is works fine(see below working example), but
when i try do the compile my gtest project with a makefile i get "undefined reference to `testing::internal::EqFailure..
." during linking step. If i exclude the testcase the linking works fine an i can run the application, but without a
TEST(...). I attached the *.cpp and *.h files of may project
I am using QNX Momentics version: 7.1.2 and compiling for v7.0.0 32bit.
working example:
qcc -std=gnu++0x -v -o gtests_main gtests_main.cpp gtests_case1.cpp -lgtest
error example:
make -j all
qcc -lang-c++ -V5.4.0,gcc_ntox86_gpp -g3 -Wall -Wp,-std=gnu++0x -o lib/gtests_case1.o -c gtests_case1.cpp
qcc -lang-c++ -V5.4.0,gcc_ntox86_gpp -g3 -Wall -Wp,-std=gnu++0x -o lib/gtests_main.o -c gtests_main.cpp
qcc -lang-c++ -V5.4.0,gcc_ntox86_gpp -o px3xtun_gtests -Wl,-lstdc++ ./lib/gtests_case1.o ./lib/gtests_main.o -lgtest
./lib/gtests_case1.o: In function `testing::AssertionResult testing::internal::CmpHelperEQ<double, int>(char const*,
char const*, double const&, int const&)':
[...]/qnx700/target/qnx7/usr/include/gtest/gtest.h:1460: undefined reference to `testing::internal::EqFailure(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::
allocator<char> > const&, bool)'
cc: [...]/qnx700/host/win64/x86_64/usr/bin/i586-pc-nto-qnx7.0.0-ld caught signal 1
make: *** [all] Error 1
makefile:28: recipe for target 'all' failed
"make -j all" terminated with exit code 2. Build might be incomplete.
|
|
|