Setup problem for header files

becozlahbecozlah Posts: 9


I have an eclipse C++ project and a configuration for static analysis, I am able to use the configuration file to perform static analysis, and generate a Parasoft C++test Report.

However, when i export the configuration file and tried to perform static analysis via the command line (cpptestcli), I encountered setup problems.

BugDetective checker: could not build analysis data
File could not be successfully parsed: /MyProject/Messages/MsgCtrl.cpp

c/c++ code checker: error during parsing file.
/MyProject/Messages/MsgCtrl.cpp:8:40: fatal error: /MyProject/Messages/MsgCtrl.h no such file or directory
#include <MsgCtrl.h>

compilation terminated.
Error preprocessing file "/MyProject/Messages/MsgCtrl.cpp"
Process excited with code: 1
Error during parsing file : /MyProject/Messages/MsgCtrl.cpp

My folder structure

            |--- main.cpp
            |--- Messages
                      |--- MsgCtrl.h
                      |--- MsgCtrl.cpp

MsgCtrl.h and MsgCtrl.cpp are in the same folder. So if C++test can find the .cpp, why is it unable to find the .h file?

My cpptestcli command:

cd /home/user/MyWorkspace
cpptestcli -data "../"
-config "/home/user/MyWorkspace/" 
-report "/home/user/MyWorkspace/Reports/MyProject.html"
-resource "MyProject/" 


  • Bogdan CzwartkowskiBogdan Czwartkowski admin Posts: 93 admin

    Hi @becozlah ,

    Please , make sure the compiler is on the PATH in the console where you run cpptestcli.

    Exit code 1 typically suggests that the compiler could not be found.

  • becozlahbecozlah Posts: 9

    Hi @Bogdan Czwartkowski ,

    I am using g++ compiler, which is located at /usr/bin/g++. I have verified the location using the "which g++" command.

    In my script, I have the following:

    export PATH="$PATH:/home/user/parasoft/cpptest-extension/9.5/"
    export PATH="$PATH:/usr/bin/"
    cd /home/user/MyWorkspace
    cpptestcli -data "../"
    -config "/home/user/MyWorkspace/" 
    -report "/home/user/MyWorkspace/Reports/MyProject.html"
    -resource "MyProject/" 

    However, the error persists.

Sign In or Register to comment.