Menu

how to run cppcheck on my local web server

2015-05-21
2015-07-03
  • shrinithi vb

    shrinithi vb - 2015-05-21

    I have a webpage where I want to use cppcheck tool to evaluate the cpp programs submitted by the user.How should I integrate the tool to my webpage?

     
  • shrinithi vb

    shrinithi vb - 2015-05-25

    Thank you so much :)

     

    Last edit: shrinithi vb 2015-05-25
  • shrinithi vb

    shrinithi vb - 2015-05-25

    I am not able create .cgi file. On executing the build file i get too many errors.Pls help

     
  • Daniel Marjamäki

    easiest solution is to update your compiler.

    To compile it with gcc-4.4.7 I need to tweak the code before I compile it:

    echo Tweak code
    cd cppcheck
    sed -i 's/template<typename T>//' lib/token.h
    sed -i 's/T&&/const std::string/' lib/token.h
    
    echo Build
    nice make
    g++ -O2 -o democlient.cgi -std=c++0x -include lib/cxx11emu.h -Ilib -DNDEBUG     democlient/democlient.cpp lib/*.o externals/tinyxml/tinyxml2.o
    
    echo Copy cgi to webspace...
    cp democlient.cgi /home/project-web/cppcheck/cgi-bin/democlient.cgi
    chmod +rx /home/project-web/cppcheck/cgi-bin/democlient.cgi
    
     
    • shrinithi vb

      shrinithi vb - 2015-05-27

      Thank u soo much!! It created the .cgi file. But if I open the file in a text editor it contains unreadable characters?

       

      Last edit: shrinithi vb 2015-05-27
  • shrinithi vb

    shrinithi vb - 2015-05-27

    I am getting the following error.
    "The server encountered an internal error and was unable to complete your request.there was an error in a CGI script."

     

    Last edit: shrinithi vb 2015-05-28
  • Daniel Marjamäki

    I dont know why.. does cgi work on your server? if you try just some simple "hello world" script does that work properly?

     
  • shrinithi vb

    shrinithi vb - 2015-06-01

    Yes the server was not configured to run cgi scripts. Now the problem is resolved :)
    The tool works partially. It does not identify errors like the one in your webpage. Is it because I tweaked the build file ??

     

    Last edit: shrinithi vb 2015-06-01
  • shrinithi vb

    shrinithi vb - 2015-06-01

    Can I edit the output of the cgi file? like I want to change the presentation of errors.

     
  • Daniel Marjamäki

    Can I edit the output of the cgi file? like I want to change the presentation of errors.

    I believe that it currently outputs xml.

    You can edit the output with xslt etc.

    If you want you can change the output from xml to text.. however you must edit the democlient.cpp sourcecode then.

     
    • shrinithi vb

      shrinithi vb - 2015-06-03

      Thank you for the suggestions :)

       
  • shrinithi vb

    shrinithi vb - 2015-06-03

    Why does online demo has a limit of 1024 characters for the programs?

     

    Last edit: shrinithi vb 2015-06-03
  • Daniel Marjamäki

    to make CPU usage low.

     
  • shrinithi vb

    shrinithi vb - 2015-06-27

    I completed the creation of the .cgi file.Now I'm integrating it with my webpage.But I am not using form to receive source code from the user.
    How to use ajax call to send the source code to the cgi file and get response from the cgi file ?

     
  • Daniel Marjamäki

    please ask web programming questions in another forum. I don't know much about web programming.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.