ROOT gcc 4.6.0 pointer error


I have ROOT 5.30 installed on my MacBook. I’m using gcc 4.6.0 which compiles everything fine, but as soon as I try to link something to any ROOT library I get an error like this:

hello(24157) malloc: *** error for object 0x7fff70012500: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug

Any idea what I can do to get it working?



Most likely the compiler used to compile ROOT is somehow not the same as the compiled used to compile your code (and/or there is mismatch between the header used for compilation and the library on the LD_LIBRARY_PATH).