Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Undefined reference error - how to add #include to .pro file ?
Forum Updated to NodeBB v4.3 + New Features

Undefined reference error - how to add #include to .pro file ?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
what
2 Posts 2 Posters 324 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by Anonymous_Banned275
    #1

    When I add a library to a project I end up with this

    INCLUDEPATH += $$PWD/../../../../../BT_Config_Library
    DEPENDPATH += $$PWD/../../../../../BT_Config_Library

    I tried to "extend " the above to INCLUDEPATH to header file.
    It did noit work

    INCLUDEPATH += $$PWD/../../../../../BT_Config_Library/bt_config_mainwindow.h

    INCLUDEPATH += $$PWD/bt_config_mainwindow.h

    I found the resource :

    https://doc.qt.io/qt-5/qmake-variable-reference.html#includepath

    OK, I got undefined reference to `BT_Configuration_MainWindow error
    It doe not tell me which .cpp in ,pro is missing it, hence I woulkd like to add required #inlcude to the .pro file without messing with existing .pro file HEADERS

    My RTFM retrieved this

    https://stackoverflow.com/questions/4134764/how-to-define-several-include-path-in-makefile

    It adds directories...

    What is a correct syntax to add

    #include "../BT_Config_Library/bt_config_mainwindow.h"

    to .pro (Makefile) ?

    INC += "../BT_Config_Library/bt_config_mainwindow.h"

    did not work and I am just too tired to " try this and try that ..."

    PS
    Reference t o Make would be nice

    :-1: error: /media/nov25-1/AAA_OS_RAID/RECOVERY_BACKUP_FEB18_/RECOVERY/BLUETOOTH/MAIN_PROJECT/../SOURCE/CCC_SOURCE/terminal_SERIAL_BLUETOOTH_VER_1/terminal_SERIAL_BLUETOOTH/terminal_BLUETOOTH//libterminal_BLUETOOTH.so: undefined reference to `BT_Configuration_MainWindow::BT_Configuration_MainWindow(QWidget*)'
    
    1 Reply Last reply
    0
    • andrA Offline
      andrA Offline
      andr
      wrote on last edited by
      #2

      Looks like the headers are fine, but you don't seem to link the library where the things from this header is implemented, i.e. something like

      LIBS += -L$SOME_PATH -lBT_Config_Library

      Seen https://doc.qt.io/qt-6/qmake-variable-reference.html#libs

      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