Important: Please read the Qt Code of Conduct -

Can't use libs after included

  • Hello,
    I am currently using QT Creator to create my own application. I created Project and chose Cmake
    This is my Cmakelist.txt:

    cmake_minimum_required(VERSION 2.8)
    find_package(PCL 1.8 REQUIRED)
    set (IMGUI_INCLUDE_DIRS "/home/nmhieu_brycenvn/Qt5/Test_File/imgui")
    set (IMGUI_DEFINITIONS "/home/nmhieu_brycenvn/Qt5/Test_File/imgui")
    add_executable(${PROJECT_NAME} "main.cpp")
    target_link_libraries (RS15 ${PCL_LIBRARIES})

    Not sure if I wrote Cmake correctly? I searched for hours to write it down, but the ImGui (a separated library) library couldn't be used, while PCL was fine.
    Can someone help me know how to include a separated library in file Cmake?
    Thanks for reading!!

  • Lifetime Qt Champion

    @Quys said in Can't use libs after included:

    target_link_libraries (RS15 ${PCL_LIBRARIES})

    You don't link against ImGui libs

  • @jsulm
    i added this to the cmakelist

    set (IMGUI_SOURCE "/home/nmhieu_brycenvn/librealsense/third-party/imgui")
    target_include_directories(RS15 PUBLIC ${IMGUI_SOURCE})

    But its still not working, am I wrong something?

  • Lifetime Qt Champion

    @Quys You don't link against ImGui libs
    You need to extend this line to link properly:

    target_link_libraries (RS15 ${PCL_LIBRARIES})

Log in to reply