[Insight-users] [insight-users] Eclipse setup : debug, viewing sources and correct project tree

Antonin Perrot-Audet antonin07130 at gmail.com
Wed Mar 10 04:59:09 EST 2010


On 3/10/10 12:51 AM, Mike Jackson wrote:
> http://www.cmake.org/Wiki/CMake:Eclipse_UNIX_Tutorial
>
> _________________________________________________________
> Mike Jackson                  mike.jackson at bluequartz.net
> BlueQuartz Software                    www.bluequartz.net
> Principal Software Engineer                  Dayton, Ohio
>
>
>
> On Tue, Mar 9, 2010 at 5:14 PM, Antonin Perrot-Audet
> <antonin07130 at gmail.com>  wrote:
>    
>> Hello,
>> After spending some time configuring ITK with Xcode, I figured out that the
>> code completion was not working, and as I'd like to have a confortable
>> environment to code (I like to have a graphical debugger ... etc...), I
>> decided to give Eclipse a try... But :
>>
>> *I have (much) trouble configuring ITK with Eclipse CDT :*
>>
>> 1)    First of all, when I import the project I get a lot of warnings :
>> "
>> Invalid project path: Include path not found
>> (/Users/antonin/[...]/Programming/ITK/Antonin/TrainEclipse/bin/(framework).
>> TRAINPROJ-
>> "
>> 2)    I can "build all", and get a nice executable in /TrainEclipse/bin/src/
>> which works perfectly when executed via a terminal, BUT, I cannot use the
>> hammer icon : build the active configuration for the active project...
>> 3)    I cannot debug, Eclipse seems not to find the executable it just
>> made... The debug configuration is almost empty, and it tells me that there
>> should not be an "@" in the configuration name...
>> 4)    the generated project doesn't show my sources, it seems like the
>> project root is the "build" directory, and my sources are not in the project
>> tree
>>
>> Here is how I organized my sources : (there is only main.cxx for testing
>> purpose)
>>
>> TrainEclipse
>> |
>> |CMakeLists.txt //content described in CMakeLists I
>> |
>> |
>> |--src
>> |    |main.cxx
>> |    |CMakeLists.txt //content described in CMakeLists II
>> |
>> |--lib
>> |    |CMakeLists.txt //content described in CMakeLists III
>> |
>> |--build
>> |    |(Cmake generated files for the eclipse project with the
>> .project...etc...)
>> |
>>
>> Here are my CMakeLists :
>>
>> *CMakeLists I :*
>> "
>> # CmakeList.txt in root of project : structure of project (OMG this is
>> heavy)
>>
>> cmake_minimum_required(VERSION 2.6)
>>
>> # Name of the project
>> PROJECT(TRAINPROJ)
>>
>> # Project structure
>> # add_subdirectory (lib) for now, no lib...
>> add_subdirectory (src)
>> "
>>
>>
>>
>> *CMakeLists II :*
>> "
>> #CmakeList.txt from the src directory
>>
>> # Find ITK.
>> FIND_PACKAGE(ITK REQUIRED)
>> IF(ITK_FOUND)
>>    INCLUDE(${ITK_USE_FILE})
>> ENDIF(ITK_FOUND)
>>
>> # Make sure the compiler can find include files from our lib folder
>> library(ies).
>> INCLUDE_DIRECTORIES(${TRAINPROJ_SOURCE_DIR}/lib)
>>
>> # Add binary called "main" that is built from the source file "main.cxx".
>> # The extension is automatically found.
>> ADD_EXECUTABLE(main main.cxx)
>>
>>
>> # Link the executable to the library(ies). (add lib after main)
>> TARGET_LINK_LIBRARIES(main ITKNumerics ITKIO itkgdcm itkvcl itkvnl
>> ITKAlgorithms ITKBasicFilters ITKCommon )
>> "
>>
>>
>>
>> *CMakeLists III :*
>> "
>> # CmakeLists.txt in lib dir
>> # Adds a library called lib (liblib.a under Linux) from the source file
>> lib.cpp
>> # ADD_LIBRARY( lib lib.cpp )
>> "
>>
>>
>>
>> And Here is how I generated the project for eclipse :
>>
>> in a terminal, from the build directory :
>> "
>> cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../
>> "
>> I simply imported the project in eclipse, specifying the /build folder where
>> the .project is.
>>
>>
>>
>> Any help would be greatly appreciated,
>>
>> Regards,
>>
>> Antonin
>>
>>
>>      
Thanks Mr Jackson, for your help, I am definitely moving forward : I now 
have a project which seems to be set up approximatively right in Eclipse :
1) I can now see my sources, in the project explorer and edit them 
etc... btw, code completion works great
2) I can compile and make a nice executable, which works well
3) I also added the false target, to run cmake from eclipse.
BUT :
1) I still have problems debugging : when I try to debug, (the bug icon)

     I get many warnings of this type :
"
warning: Unable to read symbols for "libitksys.3.16.dylib" (file not found).
warning: Unable to read symbols from "libitksys.3.16.dylib" (not yet 
mapped into memory).
"
     and then an error :
"
Target selection failed.
/dev/ttyS0: No such file or directory
   /dev/ttyS0: No such file or directory
   /dev/ttyS0: No such file or directory
"

2) I don't see my "main" in the Maketargets view, there is actually 
nothing in this view but my project's tree (and the target I manually 
added to execute Cmake)


I posted a screen capture on this server, it might be of any help 
understanding my problem :
http://fex.insa-lyon.fr/get?k=JG3zsR8MEZkeiOKHS27

Regards,

Antonin Perrot-Audet


More information about the Insight-users mailing list