How to build cppcheck tool in gcc compiler? - cppcheck

I have downloaded cppcheck tool and build it.
Now am facing the problem that cppcheck command not found.
Is there any mistake..suggest me the steps..
I tried in gcc compiler as following:
> cd /home/tcsujth/Desktop/cppcheck-1.46.1/
> g++ -o cppcheck -Ilib cli/*.cpp lib/*.cpp
> ./cppcheck
SYNTAX----------
cppcheck: error: could not find or open any of the paths given.
Segmentation fault (core dumped)
> cppcheck --version
cppcheck: Command not found.

I am a Cppcheck developer.
I assume that the g++ command finish without errors.
The "cppcheck: error: could not find or open any of the paths given" indicates that the compile was successful. It is an error that cppcheck writes if it doesn't find any source code to analyse. You must provide the path to your source code. If you provided a path then it seems something is wrong with the given path.
The segmentation fault seems interesting. Can you reproduce it with the latest Cppcheck? Feel free to report it here: http://sourceforge.net/apps/trac/cppcheck/ with some details about how it can be reproduced.
The "cppcheck: Command not found" simply means that the shell can't find cppcheck (it is not located in any path given by the PATH environment variable).
Best regards,
Daniel

I was also facing the same issue most of the time you give path including the folder of your project itself try proving path one folder behind:
Like:(assuming your project resides in "projectfolder"
instead of this-
D:\myfolder\projectfolder
try-
D:\myfolder\

Related

Cannot find Valgrind executable for use with CLion?

I am trying to connect Valgrind with CLion 2020.2.1 for testing purposes, but CLion (and perhaps I) cannot locate the Valgrind executable.
The path I am currently using is:
\\wsl$\Ubuntu\usr\bin\valgrind
But when I try to run anything with Valgrind using this path I get a message stating that it cannot run the program because of this error:
CreateProcess error=193, %1 is not a valid Win32 application
Which seemed to make sense upon further research, as what I am selecting (\usr\bin\valgrind) appears to be a .cpp source file and not an executable - as the error would indicate - but now I don't know what the issue is. If that isn't what CLion is looking for, then where is the file it is looking for?
Have also tried path '/usr/bin/valgrind/' which resulted in "Valgrind executable not found." when I tried to compile.
If anyone has any advice it would be greatly appreciated!!

CreateProcess error=206, Eclipse CDT with GCC compile ThreadX+GUIX

When I compile ThreadX+GUIX project of eclipse CDT with arm-none-eabi-gcc(Win7 64bit). It come out make (e=206). I found the same problems happened almost in JAVA development,but their solutions are not work for the CDT. Here is the compile error information:
I know the reason is because the GUIX has 1311 source files, and the compile and link operation command comes beyond the 8192 command limit. I have try to update the eclipse ,and move my workspace to the root of disk ,but the error still comes out. Now I don't know how to solve this problem. Anybody help me
If it is failing during linker/librarian stage, I modify the librarian command line to use an object_list.txt file to feed in the object file list, rather than specify them all on the command line. So something like this:
arm-elf-ar -r libguix.a #../object_list.txt
I use a python script to generate object_list.txt from the list of .c files, so it looks like this:
./common/src/gx_accordion_menu_create.o
./common/src/gx_accordion_menu_draw.o
./common/src/gx_accordion_menu_event_process.o
./common/src/gx_accordion_menu_position.o
./common/src/gx_animation_canvas_define.o
./common/src/gx_animation_complete.o
./common/src/gx_animation_create.o
./common/src/gx_animation_drag_disable.o
etc...
In your eclipse IDE there are settings to run your own custom linker command line rather than the default command line that isn't working.
Let me know if that helps you.

Compiling Qt 5.3.1 from source error at qprintsupport

I'm not sure whether or not this question has a causality with my previous question.
So, I compiled Qt 5.3.1 from source with MinGW 4.8.2. The build stopped at qtbase/src/printsupport directory, as you can see the image below:
Is it a bug or something at qtbase/src/printsupport/kernel/qprintengine_win.cpp file? Then, should I just report it to the developer?
Look here it give you a hint. Probably somewhere you use this key -Werror in make files implicitly or explicitly when start compilation with gcc. If I correct understand error in that switch operation must be default: statement or case PPK_CustomBase: statement.
miraiE,
If you will notice in your output: cc1plus.exe: all warnings being treated as errors
This is, as was mentioned before, a warning that is stopping the compile process as an error.
You should be able to run you configure.bat script again, with the option -no-warnings-are-errors.
Then re-run your make.exe to get past this, and other warnings, from stopping the build.
Details of the specific configure options below:
../qtbase-opensource-src-5.3.1/configure --help |grep -i warn
-silent ............ Reduce the build output so that warnings and errors
-no-warnings-are-errors Make warnings be treated normally
-warnings-are-errors Make warnings be treated as errors
I hope this helps!

arm-linux-androideabi stl compile error

I'm currently trying to build the android version of google breakpad on a linux machine. But it seems I'm having some issues getting the stl to be properly referenced.
I get past the configure step running ..
./configure --host=arm-linux-androideabi --disable-processor
--disable-tools
For output of this see config.log
My environment has the following variables set ..
CPP=arm-linux-androideabi-cpp
AS=arm-linux-androideabi-as
AR=arm-linux-androideabi-ar
CXX=arm-linux-androideabi-g++
CC=arm-linux-androideabi-gcc
LD=arm-linux-androideabi-ld
CFLAGS=--sysroot=/home/desktop/Development/android-ndk-r9d/platforms/android-9/arch-arm
CPPFLAGS=--sysroot=/home/desktop/Development/android-ndk-r9d/platforms/android-9/arch-arm
CXXFLAGS=--sysroot=/home/desktop/Development/android-ndk-r9d/platforms/android-9/arch-arm
SYSROOT=/home/desktop/Development/android-ndk-r9d/platforms/android-9/arch-arm
PATH=/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:.:/home/desktop/Development/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin
NDK_ROOT=/home/desktop/Development/android-ndk-r9d
NDK=/home/desktop/Development/android-ndk-r9d
When I run make -j4 I get the following errors..
src/client/linux/crash_generation/crash_generation_client.cc:34:21:
fatal error: algorithm: No such file or directory compilation terminated.
There are more similar errors related to stl (full output here). So my question is how do I get this to build with those included. I don't work in linux much so please try to be explicit with any answers.
Thanks
I added the following flags and reran config and then the compile succeeded.
CPPFLAGS=--sysroot=/home/desktop/Development/android-ndk-r9d/platforms/android-9/arch-arm -I /home/desktop/Development/android-ndk-r9d/sources/cxx-stl/stlport/stlport
LDFLAGS=-L /home/desktop/Development/android-ndk-r9d/sources/cxx-stl/stlport/libs/armeabi
LIBS=-lstlport_static

why am i seeing this libzdb configure error?

I am attempting to install libzdb on my macbook however I see the following error message when running the configure:
configure:13334: error: setjmp is required
the setjmp.h file resides within /usr/include and is specified within my "$PATH" as
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/include
Can someone please advise as to how i can rectify this issue?
thanks in advance
I've stumbled across this error while building one of my own programs when I wanted to use setjmp() and longjmp(). For some reason, the toolchain that resides in / on OS X is flawed, and the <setjmp.h> header file is missing the declarations and data types.
To fix it, I had to download Xcode (damn!) and tell the compiler to look for the headers in the freshly installed MacOSX10.7.sdk (or 8) folder:
clang -Wall -o foo foo.c -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
ok finally figured it out. For those who have seen messages like this be warned that the configure logs can be misleading. It turned out the binary built fine, however it was failing during runtime because a few mysql libraries could not be found. using the following command *export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/* would fix the problem