Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Setup problem for header files

becozlah
becozlah Posts: 10

Hi,

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.

/MyProject/Messages/MsgCtrl.cpp
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

/home/user/MyWorkspace/MyProject
        MyProject
            |--- 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/myConfig.properties" 
-report "/home/user/MyWorkspace/Reports/MyProject.html"
-resource "MyProject/" 
-nobuild

Comments

  • Bogdan Czwartkowski
    Bogdan Czwartkowski Posts: 157 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.

  • becozlah
    becozlah Posts: 10

    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/myConfig.properties" 
    -report "/home/user/MyWorkspace/Reports/MyProject.html"
    -resource "MyProject/" 
    -nobuild
    

    However, the error persists.