Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Can't use libs after included
Qt 6.11 is out! See what's new in the release blog

Can't use libs after included

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 2 Posters 552 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.
  • Q Offline
    Q Offline
    Quys
    wrote on last edited by
    #1

    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)
    
    project(RS15)
    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")
    
    include_directories(${IMGUI_INCLUDE_DIRS})
    include_directories(${PCL_INCLUDE_DIRS})
    link_directories(${PCL_LIBRARY_DIRS})
    add_definitions(${PCL_DEFINITIONS})
    add_definitions(${IMGUI_DEFINITIONS})
    
    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.
    03753f27-d5f2-48cf-ac5d-7fd268d5ac01-image.png
    Can someone help me know how to include a separated library in file Cmake?
    Thanks for reading!!

    jsulmJ 1 Reply Last reply
    0
    • Q Quys

      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)
      
      project(RS15)
      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")
      
      include_directories(${IMGUI_INCLUDE_DIRS})
      include_directories(${PCL_INCLUDE_DIRS})
      link_directories(${PCL_LIBRARY_DIRS})
      add_definitions(${PCL_DEFINITIONS})
      add_definitions(${IMGUI_DEFINITIONS})
      
      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.
      03753f27-d5f2-48cf-ac5d-7fd268d5ac01-image.png
      Can someone help me know how to include a separated library in file Cmake?
      Thanks for reading!!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

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

      target_link_libraries (RS15 ${PCL_LIBRARIES})

      You don't link against ImGui libs

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Q 1 Reply Last reply
      3
      • jsulmJ jsulm

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

        target_link_libraries (RS15 ${PCL_LIBRARIES})

        You don't link against ImGui libs

        Q Offline
        Q Offline
        Quys
        wrote on last edited by
        #3

        @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?

        jsulmJ 1 Reply Last reply
        0
        • Q Quys

          @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?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          target_link_libraries (RS15 ${PCL_LIBRARIES})
          

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2

          • Login

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