cppunit 交叉编译失败,总是提示找不到cppunit的头文件,求救!!
1.安装cppunit时已经运行./configure --host==armv6zk-gnueabi
2.安装并编译好后,
3.将库文件移动到usr/local/lib,
4.并且修改了/etc/profile
5.将cppunit的头文件拷贝到编译器的c++/4.3.2/include文件下
写了一个最简单的Helloworld代码,
C/C++ code
#include <iostream>
#include <cppunit/TestRunner.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
using namespace std;
int main()
{
cout<<"shit"<<endl;
}
编译后出现如下错误提示:
test2.cpp:2:32: error: cppunit/TestRunner.h: No such file or directory
test2.cpp:3:32: error: cppunit/TestResult.h: No such file or directory
test2.cpp:4:41: error: cppunit/TestResultCollector.h: No such file or directory
test2.cpp:6:45: error: cppunit/extensions/HelperMacros.h: No such file or directory
test2.cpp:7:47: error: cppunit/BriefTestProgressListener.h: No such file or directory
test2.cpp:8:52: error: cppunit/extensions/TestFactoryRegistry.h: No such file or directory
如果上面有描述不清楚的地方,请各位及时提出,谢谢
------解决方案--------------------
你的是在 include下面 有一个cppunit目录吗?还是把头文件直接拷过去了,不是放在这个目录里,不行你就把目录都去掉,用#include “TestRunner.h”把头文件和程序放一起看看能不能编译,应该 是你放的位置的问题