我正在尝试使用cpputest构建一个简单的单元测试可执行文件。我已经将cpputest框架构建到一个静态库中,并且现在正试图将它链接到一个可执行文件中。但是,由于相关的代码,我被绑定到相当复杂的Makefile设置中。未定义的运营商新引用
这是我的命令行:
/usr/bin/qcc -V4.2.4,gcc_ntoarmle_acpp-ne -lang-c++ -O2 -g -g -o Application/UnitTests/Tests/symbols/UnitTestExe -Wl,--start-group Application/UnitTests/Tests/../.objs/main.o Application/UnitTests/lib/libcpputest.a -Wl,--end-group -lm
我得到许多错误像下面这样:
Application/UnitTests/lib/libcpputest.a(CommandLineTestRunner.o): In function `CommandLineTestRunner::parseArguments(TestPlugin*)':
Application/UnitTests/cpputest/src/CppUTest/.objs/../CommandLineTestRunner.cpp:114: undefined reference to `operator new(unsigned int, char const*, int)'
我想不出什么导致这一点。我不用C++免费获得运算符新的版本吗?
根据这些信息确实很难提供帮助。尝试*减少重现问题所需的条件。上面的命令行太复杂了,即使我们假设代码很简单,并且不执行重新定义'operator new'等操作。 – 2010-09-17 13:43:19
第一个错误是否报告了操作员新错误?如果不是,报告的第一个错误是什么? – 2010-09-17 13:50:28
是的,报告的唯一错误是操作员新错误。显示的那个是第一个。 – mbyrne215 2010-09-17 13:50:57