[Insight-users] debugging problem using gdb

Luis Ibanez luis.ibanez at kitware.com
Wed Apr 1 13:46:24 EDT 2009


Hi 李健

Are you stopping the program using breakpoints ?

If you just let it run without breakpoints then
all the variables will be out of scope by the
time you can as for prints.


   Regards,


       Luis



-----------
李健 wrote:
> Dear all,
>  
> When I was debugging a cpp file which uses itk and some class and 
> library I wrote, I can't print any variables in the main function. There 
> is only main function in this cpp file, no other functions. But it 
> always says that no symbol "  " in the current context.
> I've already typed " Debug" in the build type line.
>  
> the following is the CMakeLists.txt:
>  
> cmake_minimum_required(VERSION 2.6)
> PROJECT(LLL)
> FIND_PACKAGE(ITK)
> IF(ITK_FOUND)
>   INCLUDE(${ITK_USE_FILE})
> ELSE(ITK_FOUND)
>   MESSAGE(FATAL_ERROR
>           "ITK not found. Please set ITK_DIR.")
> ENDIF(ITK_FOUND)
> ADD_EXECUTABLE(LLL  LLL.cpp)
> find_library(IMAGE_LIBRARY NAMES image PATHS /home/zhuzhu/lib)
> TARGET_LINK_LIBRARIES(LLL  ${ITK_LIBRARIES} ${IMAGE_LIBRARY} z)
>  
>  
>  
> Thanks a lot.
> 
> ------------------------------------------------------------------------
> 微软地图实时路况,为您节省的不仅仅是时间! 立即查看! 
> <http://ditu.live.com/default.aspx?v=2&form=MICHAJ&cp=qcbgzzsz1gzz&style=r&lvl=4&tilt=-90&dir=0&alt=-1000&phx=0&phy=0&phscl=1&trfc=1&encType=1>
> 
> 
> ------------------------------------------------------------------------
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list