Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. qtcreator cannot debug with cmake debug-build
Forum Updated to NodeBB v4.3 + New Features

qtcreator cannot debug with cmake debug-build

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
qtcreator
1 Posts 1 Posters 435 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mountqi
    wrote on last edited by
    #1

    Platform: openSUSE linux 15.2
    cmake-3.17.0
    g++-7.5.0
    Qt Creator 4.12.0 Based on Qt 5.12.7 (GCC 7.5.0, 64 bit)

    I'm using qtcreator to debug my c++ program build by cmake. I'm sure it's a debug version and verified debug by gdb.
    However, everytime I press debug button, the process started, the cursor stopped on the first breakpoint, but the output was something wrong like this:

    can't find linker symbol for virtual table for CFieldClassifier' value found std::allocator<char>::~allocator()@got.plt' instead
    can't find linker symbol for virtual table for CFieldClassifier' value found std::allocator<char>::~allocator()@got.plt' instead
    can't find linker symbol for virtual table for CMaskEngine' value can't find linker symbol for virtual table for CMaskEngine' value
    can't find linker symbol for virtual table for COpticalFilm' value can't find linker symbol for virtual table for COpticalFilm' value
    can't find linker symbol for virtual table for CSificAppl' value can't find linker symbol for virtual table for CSificAppl' value
    can't find linker symbol for virtual table for CFieldClassifier' value found std::allocator<char>::~allocator()@got.plt' instead
    can't find linker symbol for virtual table for CFieldClassifier' value found std::allocator<char>::~allocator()@got.plt' instead

    GDB doesn't produce this kind of output and the debug progress is fluent.

    I created a trial c++ project with cmake build in qtcreator. Then the debug is ok.
    It may be some wrong configuration in my CMakeLists.txt, but debug works well with manual GDB, with kdevelop and vs code. I cannot figure why and looking for help.

    Following is my CMakeLists.txt content:


    cmake_minimum_required(VERSION 3.5)
    
    project(f4_library)
    
    ############################################################
    # Create a library: Olambda
    ############################################################
    
    set(lib_SOURCES boostwrappers.cpp basicgeometry.cpp copticalnumerics.cpp
      engines/cilluminationengine.cpp engines/cmaskengine.cpp engines/cfilmstackengine.cpp
      engines/cprojectionengine.cpp engines/cchemicalengine.cpp engines/copticssolver.cpp mathOL.cpp
      engines/cvariationengine.cpp applications/ccalibappl.cpp applications/csificappl.cpp
      engines/cfilmstacksolution.cpp geometryOL.cpp engines/celectricalengine.cpp
      applications/copcappl.cpp engines/cresistengine.cpp engines/cetchingengine.cpp
      engines/clithoengine.cpp engines/cexposureengine.cpp oltree.cpp optimizers.cpp polynomials.cpp
      cpageandbookt.cpp basictypes.cpp cvectorandfieldt.cpp cvarvar.cpp cdpmanager.cpp
      cambitzone.cpp olenv.cpp engines/cenginebase.cpp applications/capplbase.cpp
      engines/cshapeengines.cpp cfiledatabitmap.cpp engines/cmaterialsliceengine.cpp ccontours.cpp
      engines/cmaterialdomainengine.cpp cioport.cpp cgeometryprocessor.cpp engines/ccirsymcvs2vtrvv.cpp
      cappandengbase.cpp cvsformt.cpp engines/cpebperturb.cpp
      cfieldclassifier.cpp clayoutpaintpage.cpp engines/cpebengine.cpp engines/cdeveloperengine.cpp
      cpockettester.cpp gdsio.cpp engines/cpagengine.cpp EulerPEB.cpp FastMarch.cpp )
    
    
    add_library(Olambda SHARED ${lib_SOURCES})
    set_target_properties(Olambda PROPERTIES PREFIX "")
    #add_compile_options(-M -MT  -ftemplate-depth-100)
    
    target_include_directories(Olambda
        PUBLIC ${PROJECT_SOURCE_DIR}
        PUBLIC ${PROJECT_SOURCE_DIR}/engines
        PUBLIC /usr/include/python3.6m
        PUBLIC /usr/local/include
        PUBLIC /usr/local/include/klayout
        PUBLIC /usr/local/include/freeglut
    )
    
    target_link_libraries(Olambda
        PUBLIC m
        PUBLIC pthread
        PUBLIC fftw3f
        PUBLIC python3.6m 
        PUBLIC boost_python36
        PUBLIC boost_system
        PUBLIC klayout_drc
        PUBLIC klayout_db   
    )
    
    target_compile_definitions(Olambda PRIVATE HAVE_CONFIG_H FFTW_IN_FLOAT PIC)
    
    set_target_properties(Olambda PROPERTIES LINK_FLAGS "-Bdynamic")
    
    
    # copy olambda to python-app directory
    add_custom_command(TARGET Olambda POST_BUILD
      COMMAND $(CMAKE_COMMAND) -E copy $<TARGET_FILE:Olambda> ${PROJECT_SOURCE_DIR}/../../f4-python
      COMMENT "Olambda is copied"
    )
    
    
    add_library(Olambda_static STATIC ${lib_SOURCES})
    target_compile_definitions(Olambda_static PRIVATE HAVE_CONFIG_H FFTW_IN_FLOAT PIC)
    set_target_properties(Olambda_static PROPERTIES LINK_FLAGS "-Bdynamic")
    
    
    target_include_directories(Olambda_static
        PUBLIC ${PROJECT_SOURCE_DIR}
        PUBLIC ${PROJECT_SOURCE_DIR}/engines
        PUBLIC /usr/include/python3.6m
        PUBLIC /usr/local/include
        PUBLIC /usr/local/include/klayout
        PUBLIC /usr/local/include/freeglut
    )
    
    target_link_libraries(Olambda_static
        PUBLIC m
        PUBLIC pthread
        PUBLIC fftw3f
        PUBLIC python3.6m
        PUBLIC boost_python36
        PUBLIC boost_system
        PUBLIC klayout_drc
        PUBLIC klayout_db
    )
    
    
    ############################################################
    # Create a app: sific
    ############################################################
    
    add_executable(sific executable/do_sific.cpp)
    #add_compile_options( -MT )
    
    target_include_directories(sific
        PUBLIC ${PROJECT_SOURCE_DIR}
        PUBLIC ${PROJECT_SOURCE_DIR}/engines
        PUBLIC /usr/include/python3.6m
        PUBLIC /usr/local/include
        PUBLIC /usr/local/include/klayout
        PUBLIC /usr/local/include/freeglut
    )
    
    target_compile_definitions(sific PRIVATE HAVE_CONFIG_H FFTW_IN_FLOAT PIC)
    
    target_link_libraries(sific
        PUBLIC klayout_tl
        PUBLIC Olambda
    )
    
    # copy olambda to python-app directory
    add_custom_command(TARGET sific POST_BUILD
      COMMAND $(CMAKE_COMMAND) -E copy $<TARGET_FILE:sific> ${PROJECT_SOURCE_DIR}/../../f4-python
      COMMENT "sific is copied"
    )
    
    
    ############################################################
    # Create a app: resist
    ############################################################
    
    add_executable(resist executable/do_resist.cpp)
    #add_compile_options(-MT -M -ftemplate-depth-100)
    target_include_directories(resist
        PUBLIC ${PROJECT_SOURCE_DIR}
        PUBLIC ${PROJECT_SOURCE_DIR}/engines
        PUBLIC /usr/include/python3.6m
        PUBLIC /usr/local/include
        PUBLIC /usr/local/include/klayout
        PUBLIC /usr/local/include/freeglut
    )
    
    target_compile_definitions(resist PRIVATE HAVE_CONFIG_H FFTW_IN_FLOAT PIC)
    
    set_target_properties(resist PROPERTIES LINK_FLAGS "-Bdynamic")
    
    
    target_link_libraries(resist
        PUBLIC klayout_tl
        PRIVATE Olambda_static
    #    PUBLIC Olambda
    )
    
    add_custom_command(TARGET sific POST_BUILD
      COMMAND $(CMAKE_COMMAND) -E copy $<TARGET_FILE:resist> ${PROJECT_SOURCE_DIR}/../../f4-python
      COMMENT "resist is copied"
    )***
    

    Screenshot_20201224_102700.png

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved