Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

error LNK2019: unresolved external symbol



  • I try to run an project and the fallowing 19 errors appear :

    -main.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall LabelBox::LabelBox(class ImageView *,class QWidget *)" (??0LabelBox@@QAE@PAVImageView@@PAVQWidget@@@Z) referenced in function _main
    -mainwindow.obj:-1: error: LNK2001: unresolved external symbol "public: __thiscall LabelBox::LabelBox(class ImageView *,class QWidget *)" (??0LabelBox@@QAE@PAVImageView@@PAVQWidget@@@Z)
    -imageview.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall SliderBar::SliderBar(enum Qt::Orientation)" (??0SliderBar@@QAE@W4Orientation@Qt@@@Z) referenced in function "public: __thiscall ImageView::ImageView(void)" (??0ImageView@@QAE@XZ)
    -imageview.obj:-1: error: LNK2019: unresolved external symbol "public: void __thiscall SliderBar::setSegmentVisibleEye(class std::vector<bool,class std::allocator<bool> >)" (?setSegmentVisibleEye@SliderBar@@QAEXV?$vector@_NV?$allocator@_N@std@@@std@@@Z) referenced in function "public: void __thiscall ImageView::setSliderSegmentEyes(class std::vector<bool,class std::allocator<bool> >)" (?setSliderSegmentEyes@ImageView@@QAEXV?$vector@_NV?$allocator@_N@std@@@std@@@Z)
    

    here is my .pro file :

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    QT       += core gui charts
    
    TARGET = LabelingTool
    TEMPLATE = app
    CONFIG += c++11
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which has been marked as deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    
    
    INCLUDEPATH += /usr/local/include/
    LIBS += -L/usr/local/lib64 -losg -losgDB -losgGA -losgViewer -losgText
    
    SOURCES += \
            src/main.cpp \
            src/MainWindow/mainwindow.cpp \
            src/MainOsgViewer/mainosgviewer.cpp \
            src/LabelData/labeldata.cpp \
            src/LabelEventHandler/labeleventhandler.cpp \
            src/ImageView/imageview.cpp \
            src/InformationFormular/informationformular.cpp \
            src/Polynomial/polynomial.cpp \
            src/Chart/chart.cpp
    
    
    HEADERS += \
            src/MainWindow/mainwindow.h \
            src/MainOsgViewer/mainosgviewer.h \
            src/LabelData/labeldata.h \
            src/LabelEventHandler/labeleventhandler.h \
            src/ImageView/imageview.h \
            src/InformationFormular/informationformular.h \
            src/Polynomial/polynomial.h \
            src/Chart/chart.h
    
    DISTFILES += \
        CMakeLists.txt
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -lOpenThreads
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -lOpenThreadsd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -lOpenThreads
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgAnimation
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgAnimationd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgAnimation
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losg
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losg
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgDB
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgDBd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgDB
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgFX
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgFXd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgFX
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgManipulator
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgManipulatord
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgManipulator
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    
    
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgParticle
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgParticled
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgParticle
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgPresentation
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgPresentationd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgPresentation
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgShadow
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgShadowd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgShadow
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgSim
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgSimd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgSim
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgTerrain
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgTerraind
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgTerrain
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgText
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgTextd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgText
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUI
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUId
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUI
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUtil
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUtild
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgUtil
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgViewer
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgViewerd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgViewer
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgVolume
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgVolumed
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgVolume
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgWidget
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgWidgetd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgWidget
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgGA
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgGAd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgGA
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    INCLUDEPATH += $$PWD/Dependencies/build_dir/include/eigen3
    DEPENDPATH += $$PWD/Dependencies/build_dir/include/eigen3
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/yaml-cpp-masterr/lib/ -llibyaml-cppmd
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/yaml-cpp-masterr/lib/ -llibyaml-cppmdd
    else:unix: LIBS += -L$$PWD/Dependencies/yaml-cpp-masterr/lib/ -llibyaml-cppmd
    
    INCLUDEPATH += $$PWD/Dependencies/yaml-cpp-masterr/include
    DEPENDPATH += $$PWD/Dependencies/yaml-cpp-masterr/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losg
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losgd
    else:unix: LIBS += -L$$PWD/Dependencies/OSG.3.4.0/lib/ -losg
    
    INCLUDEPATH += $$PWD/Dependencies/OSG.3.4.0/include
    DEPENDPATH += $$PWD/Dependencies/OSG.3.4.0/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Core
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Cored
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Core
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Gui
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Guid
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Gui
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Svg
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Svgd
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Svg
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Widgets
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Widgetsd
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Widgets
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Script
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Scriptd
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Script
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lqtmain
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lqtmaind
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lqtmain
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
    

    Anyone have an idea way this is happening ?



  • Where are LabelBox and SliderBar defined and implemented?

    P.S.
    all that

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Core
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Cored
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Core
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Gui
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Guid
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Gui
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Svg
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Svgd
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Svg
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Widgets
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Widgetsd
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Widgets
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/include
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Script
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Scriptd
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lQt5Script
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lqtmain
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lqtmaind
    else:unix: LIBS += -L$$PWD/../../Qt/5.11.2/msvc2015/lib/ -lqtmain
    
    INCLUDEPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
    DEPENDPATH += $$PWD/../../Qt/5.11.2/msvc2015/lib
    

    can be replaced with
    QT += core gui svg script widgets
    http://doc.qt.io/qt-5/qmake-variable-reference.html#qt


Log in to reply