0
我是OS X用户,我最近安装了“cppunit”库,使用brew。当我尝试编译 “TEST.CPP” 文件中使用TestCase.h头发生错误:C++库头未找到
> test.cpp:3:10: fatal error: 'TestCase.h' file not found
> #include "TestCase.h"
我编译这个文件:
TEST.CPP
#include <iostream>
#include "TestCase.h"
using namespace CppUnit;
class EmptyTest : public TestCase
{
};
int main()
{
}
使用这个命令:
g++ -Wall -pedantic -std=c++14 test.cpp -o test.x -lcppunit
我也试过编译-I给出了库目录的路径,但仍然有相同的错误。 所有使用cppunit和brew的朋友都可以简单的包含头文件,程序运行良好。
我希望每一个答案。
如果它对你的朋友有同样的步骤,似乎不太可能从这里诊断出来。 –