Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ c++;编译cppunt文件并执行xml报告_C++_G++_Cppunit - Fatal编程技术网

C++ c++;编译cppunt文件并执行xml报告

C++ c++;编译cppunt文件并执行xml报告,c++,g++,cppunit,C++,G++,Cppunit,我有一些.cpp和.h文件驻留在路径中 ~/NetBeansProject/myApplication main.cpp person.cpp person.h 我的cppunit.cpp和.h文件位于路径中 ~/NetBeansProjects/myApplication/tests TestCase.cpp TestCase.h finalresults.cpp 假设我在~并且我有cd到目录 /NetBeansProjects/myApplication in my terminal

我有一些.cpp和.h文件驻留在路径中

~/NetBeansProject/myApplication

main.cpp
person.cpp
person.h
我的cppunit.cpp和.h文件位于路径中

~/NetBeansProjects/myApplication/tests

TestCase.cpp
TestCase.h
finalresults.cpp
假设我在~并且我有cd到目录

/NetBeansProjects/myApplication in my terminal
我想在cppunit文件中使用g++生成cppunit测试结果的XML报告

我在finalresults.cpp中添加XmlOutputter

        std::ofstream xmlFileOut("testResults.xml");
    XmlOutputter xmlOut(&collectedresults, xmlFileOut);
    xmlOut.write();

the command to use(as suggested) g++ -o finaltestresults person.cpp main.cpp tests/TestCase.cpp tests/finalresults.cpp -lcppunit
我的程序运行成功,但没有创建xml


我还需要执行哪些其他步骤?

g++-o finalresults main.cpp person.cpp tests/TestCase.cpp tests/finalresults.cpp
-lcppunit

我在finalresults.cpp中添加了一个xmoutputer,我运行了该命令,它成功构建了我的程序,但没有创建xml。我该怎么办?