User forums > Using Code::Blocks

I have installed CppCheck but get an error when I try to run it in.

<< < (2/3) > >>

CJS:
I've used Dr. Memory to check for memory leaks - it identifies uninitialized memory, accesses to unaddressable memory, accesses to freed memory, double frees, memory leaks, handle leaks on Windows etc.

It works with binaries on Windows, Linux, or Mac (it currently targests 32-bit applications only, although I suppose you could get some useful information about a 64-bit target by building a 32-bit version as there would be memory leaks with common causes regardless of architecture).

Home page:
http://drmemory.org/

Download link from home page:
https://github.com/DynamoRIO/drmemory/wiki/Downloads

I have checked it out on Norton safe web and Web of Trust and found no issues.

The version I used was 1.8.0-8

Sometimes it crashed before finishing but still provided useful log results.

raynebc:
Similarly, memwatch is a small bit of source code you can add to your project and it reports on memory errors like wild frees, double frees, buffer overflows, etc.

However, you are aware that you can run cppcheck outside of Code::Blocks, right?

BlueHazzard:
Just to make some things clear:
1) CppCheck is a statc code analyzer, so cppcheck is unaware what compiler you are using for your program or what your platform is
2) CppCheck is a stand alone program, the  c::b plugin simply calls cppcheck.exe on all project files and parses the log so errors like:

--- Quote from: Dice on January 16, 2016, 04:25:01 am ---The program can't start because MSVCP140.dll is missing from your computer.  Try reinstalling the program to fix this problem." 

--- End quote ---
is a runtime error of cppcheck not c::b. This has nothing  to do with your compiler or with codeblocks. It says simply that your cppcheck version is compiled with the visual studio 2015 runtime. This also don't mean that you have to install Visual Studio, or the Visual Studio compiler. You simply have to install the Visual Studio Runtime libraries, (a batch of dlls). You can find them here: https://www.microsoft.com/en-us/download/details.aspx?id=48145 If you install them cppcheck should run without problems


--- Quote from: raynebc on January 20, 2016, 08:14:09 pm ---However, you are aware that you can run cppcheck outside of Code::Blocks, right?

--- End quote ---
No he can't because his VC Runtime is missing....


--- Quote from: Dice on January 20, 2016, 06:41:19 am ---Thanks for the help everyone.  This is getting more complicated than I'm comfortable with.  I think I'll just end up writing a wrapper for malloc() and free() to look for memory leaks.

--- End quote ---
You are thinking way to complicated... Simply install the runtime ;)

BUT: For finding memory leaks cppcheck is not the best tool. On linux i would recommend Valgrind but this tool does not exists on windows. So Dr. Memory is a good alternative or as you said overwriting malloc and free...

greetings

raynebc:
Sure, he could use cppcheck after he installed the runtime that was linked very early into the thread.  What I'm saying is his posts made it sound like he thought Cppcheck could only be invoked from within Code:blocks.

I've never heard of a Valgrind equivalent for Windows, but MemWatch is basically just that:  A wrapper system for the standard C memory allocation and freeing routines (ie. malloc() and free()).

JangoUnchained:
I faced with this problem too. There are two good ways to solve it. First of all you should try to reinstall MS c++ visual studio 2015. It helps usually. It this didn't helped you, try to find missing file in internet, on a well trusted websites, for example fix4dll.com/msvcp140_dll and add it to your system folder depending on windows version.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version