[Insight-users] ITK/Eclipse configuration problem
Luis Ibanez
luis.ibanez at kitware.com
Sat May 19 18:05:49 EDT 2007
Hi Matthew,
From your description it seems that the Debug compilation
flags are not making it into the Makefile.
Please do a recursive grep in the project directory in
search of the "-g" flag in the Makefiles.
You can also take the resulting executable, and try to
run it from gdb or ddd to see if you manage to set
breakpoints. If breakpoints don't work in gdb or ddd
then your executable was probably built without -g.
As a temporary fix, you can simply add the "-g" flag
to the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.
Please let us know what you find.
Thanks,
Luis
----------------------
Fleming, Matthew wrote:
> Folks,
>
> I would like to use Eclipse for ITK programming. (I am new to both, so if the following has an obvious solution that I have missed, please excuse me.) I installed Eclipse with CDT and the CMake plug-in, as well as ITK, on Ubuntu Linux. I then used the example from InsightToolkit-3.2.0/Examples/Installation, building the Makefile with CMake and importing the project into Eclipse as a "Standard C++ Makefile Project". In this, I was basically following the instructions from http://www.cmake.org/Wiki/CMake_Editors_Support. Everything worked as advertised, except for one problem; I was able to use CMake from within Eclipse to regenerate the Makefile and clean, build, and run the HelloWorld application. The problem is that debugging doesn't quite work. When I start the debug, execution stops at the beginning of the program, and when I then press the "Resume" button, it runs to completion, even if breakpoints are set. Presumably this problem has a simple solution, but I've been
looking at it for awhile now, and can't determine what it is. Any suggestions would be much appreciated.
>
> I've included the contents of my CmakeLists.txt below.
>
> Thanks,
>
> Matthew Fleming
>
> # This project is designed to be built outside the Insight source tree.
> PROJECT(HelloWorld)
>
> # Find ITK.
> FIND_PACKAGE(ITK REQUIRED)
> IF(ITK_FOUND)
> INCLUDE(${ITK_USE_FILE})
> ENDIF(ITK_FOUND)
>
> IF(CMAKE_COMPILER_IS_GNUCC)
> SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
> ENDIF(CMAKE_COMPILER_IS_GNUCC)
> IF(CMAKE_COMPILER_IS_GNUCXX)
> SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
> ENDIF(CMAKE_COMPILER_IS_GNUCXX)
>
> SET(CMAKE_VERBOSE_MAKEFILE ON)
>
> SET(CMAKE_BUILD_TYPE "Debug")
>
>
> ADD_EXECUTABLE(HelloWorld HelloWorld.cxx )
>
> TARGET_LINK_LIBRARIES(HelloWorld ITKCommon)
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list