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的朋友都可以簡單的包含頭文件,程序運行良好。
我希望每一個答案。
如果它對你的朋友有同樣的步驟,似乎不太可能從這裏診斷出來。 –