google搜索 51Testing站内搜索                    软件测试门户 | 软件测试培 训 | 文章资料精选 | 软件测试论坛 | 软件测试博客 | 测试招聘求职 
打印

请问这里有用CUnit的吗?帮帮我吧。。。

请问这里有用CUnit的吗?帮帮我吧。。。


我看了文章《C语言单元测试》,然后在Linux下编译了CUnit,但是按照文章中的方法建立一个有三个文件的工程:
1.  func.c :定义maxi()函数
2. test_func.c :定义测试用例和测试包
3. run_test.c :调用CUnit的Automated接口运行测试
4. Makefile :生成测试程序。

但是在编译的时候老是报错:
/tmp/ccg2VV4R.o(.text+0x36): In function `testIQJ':
: undefined reference to `CU_assertImplementation'
/tmp/ccg2VV4R.o(.text+0x6c): In function `testIQJ':
: undefined reference to `CU_assertImplementation'
/tmp/ccg2VV4R.o(.text+0xab): In function `testIGJ':
: undefined reference to `CU_assertImplementation'
/tmp/ccg2VV4R.o(.text+0xe1): In function `testIGJ':
: undefined reference to `CU_assertImplementation'
/tmp/ccg2VV4R.o(.text+0x118): In function `testIGJ':
: und
...........

应该是头文件和库文件链接的有问题吧?
能详细给我描述一下你是如何编译安装的吗?
configure --prefix= 用的是什么?
这些例子文件的目录结构是怎么样的吗?

谢谢。。。

TOP

不懂CUnit,但根据编译报错来分析,应该是头文件包含不对,编译时没有找到CU_assertImplementation定义的地方。可以查找一下CU_assertImplementation是在Cunit哪个头文件里定义的。

TOP

 
当前时区 GMT+8, 现在时间是 2008-8-30 05:59Copyright(C)上海博为峰软件技术有限公司 2001-2007 电话:021-64471599-8017
当您在访问网站、论坛及博客过程中遇到问题时可发送email:webmaster@51testing.com或发送论坛短信至管理员风在吹