如何在QNX 6.5.0上编译googleTestLibrary ?



我想在QNX上编译谷歌测试库。但我没有成功。我什么都试过了。可以在

下面看到我的编译错误

是否有人共享到libGoogleTest_g。alibGoogleTest. aa文件给我吗?

D:/ETCT_PROJECTS/CommonLibrary/Test/ETCCommon/Common/QNXUnitTests/../../../../GoogleTestLibrary/liblibgoogleTest_g.a(gtest-all.o): 
In function `_M_initialize_dispatch<const char* const*>':
/usr/qnx650/target/qnx6/usr/include/c++/4.4.2/ext/new_allocator.h:87: undefined reference to `std::__throw_bad_alloc()'
D:/ETCT_PROJECTS/CommonLibrary/Test/ETCCommon/Common/QNXUnitTests/../../../../GoogleTestLibrary/liblibgoogleTest_g.a(gtest-all.o): 
In function `operator<< <char, std::char_traits<char>, std::allocator<char> >':
/usr/qnx650/target/qnx6/usr/include/c++/4.4.2/bits/basic_string.h:2506:
 undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
D:/ETCT_PROJECTS/CommonLibrary/Test/ETCCommon/Common/QNXUnitTests/../../../../GoogleTestLibrary/liblibgoogleTest_g.a(gtest-all.o): 
In function `ValueHolder':
/usr/qnx650/target/qnx6/usr/include/c++/4.4.2/ext/new_allocator.h:87: undefined reference to `std::__throw_bad_alloc()'
D:/ETCT_PROJECTS/CommonLibrary/Test/ETCCommon/Common/QNXUnitTests/../../../../GoogleTestLibrary/liblibgoogleTest_g.a(gtest-all.o): In function `~DeathTestImpl':
/home/emres/GoogleTest/./src/gtest-death-test.cc:374:
 undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/home/emres/GoogleTest/./src/gtest-death-test.cc:374:
 undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'
/home/emres/GoogleTest/./src/gtest-death-test.cc:374:
 undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)'

检查此链接以修复编译问题。https://code.google.com/p/googletest/issues/detail?id=444修复编译问题后,按照以下步骤创建静态库文件。

  • 生成gtest-all。o对象文件的所有配置(DEBUG RELEASE)只需打开QNX的时刻和右键单击gtest-all.cc
  • 登录到QNX,并复制您的gtest-all。0文件到任意目录
  • 输入文件复制到的目录
  • 使用ar(archive)命令创建静态库,如下所示。

    DEBUG: ar -rv libgoogle_test_g。gtest-all.o

    RELEASE: ar -rv libgoogle_test。gtest-all.o

复制*。并在您的项目中使用新的静态库

相关内容

  • 没有找到相关文章

最新更新