[CMake] CMake and GDB

GOO Creations goocreations at gmail.com
Wed Sep 19 10:43:41 EDT 2012


Hi,

I'm trying to debug my program using GDB. I've done the following:

-DCMAKE_BUILD_TYPE=Debug
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")

But whenever I run GDB and do a backtrace, I get a message: "No Stack".
I've done a Google search and apparently the -g flag is never passed to g++.
Is -g automatically added when my build type is "Debug"? Does anyone 
know why GDB gives me this error?

Thanks
Chris


More information about the CMake mailing list