Try to add library to Project,but can't linked,Error LNK2019



  • Hi all, I followed the "Clean Project->qmake->build" procedure and tried to run qtcreator as administrator. But seems the project didn't find and link the EDSDK.dll.
    I don't know why...
    Please have a look for me, thanks all.

    #-------------------------------------------------
    #
    # Project created by QtCreator 2019-05-15T09:00:49
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = AOISystem
    TEMPLATE = app
    
    # 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
    
    CONFIG += c++11
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp
    
    HEADERS += \
            common.h \
            mainwindow.h
    
    FORMS += \
            mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    
    win32:LIBS += -luser32
    msvc: LIBS += -luser32
    
    
      win32:debug {
          CONFIG += console
      }
    
    win32: LIBS += -LD:/Qtlibs/EDSDK_64/Library/ -lEDSDK
    
    INCLUDEPATH += D:/Qtlibs/EDSDK_64/Header
    DEPENDPATH += D:/Qtlibs/EDSDK_64/Header
    LIBS += -Ldll -lws2_32
    
    
    09:51:59: Running steps for project AOISystem...
    09:51:59: Configuration unchanged, skipping qmake step.
    09:51:59: Starting: "D:\Qt\Tools\QtCreator\bin\jom.exe" 
    	D:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
    	D:\Qt\5.9.8\msvc2017_64\bin\uic.exe ..\AOISystem\mainwindow.ui -o ui_mainwindow.h
    	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\AOISystem.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\AOISystem -I. -ID:\Qtlibs\EDSDK_64\Header -ID:\Qt\5.9.8\msvc2017_64\include -ID:\Qt\5.9.8\msvc2017_64\include\QtWidgets -ID:\Qt\5.9.8\msvc2017_64\include\QtGui -ID:\Qt\5.9.8\msvc2017_64\include\QtANGLE -ID:\Qt\5.9.8\msvc2017_64\include\QtCore -Idebug -I. -ID:\Qt\5.9.8\msvc2017_64\mkspecs\win32-msvc -Fodebug\ @C:\Users\17suo\AppData\Local\Temp\main.obj.332.0.jom
    main.cpp
    	cl -BxD:\Qt\5.9.8\msvc2017_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E D:\Qt\5.9.8\msvc2017_64\mkspecs\features\data\dummy.cpp 2>NUL >debug\moc_predefs.h
    	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\AOISystem.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\AOISystem -I. -ID:\Qtlibs\EDSDK_64\Header -ID:\Qt\5.9.8\msvc2017_64\include -ID:\Qt\5.9.8\msvc2017_64\include\QtWidgets -ID:\Qt\5.9.8\msvc2017_64\include\QtGui -ID:\Qt\5.9.8\msvc2017_64\include\QtANGLE -ID:\Qt\5.9.8\msvc2017_64\include\QtCore -Idebug -I. -ID:\Qt\5.9.8\msvc2017_64\mkspecs\win32-msvc -Fodebug\ @C:\Users\17suo\AppData\Local\Temp\mainwindow.obj.332.16.jom
    mainwindow.cpp
    	D:\Qt\5.9.8\msvc2017_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --compiler-flavor=msvc --include debug/moc_predefs.h -ID:/Qt/5.9.8/msvc2017_64/mkspecs/win32-msvc -IC:/Users/17suo/Documents/AOISystem -ID:/Qtlibs/EDSDK_64/Header -ID:/Qt/5.9.8/msvc2017_64/include -ID:/Qt/5.9.8/msvc2017_64/include/QtWidgets -ID:/Qt/5.9.8/msvc2017_64/include/QtGui -ID:/Qt/5.9.8/msvc2017_64/include/QtANGLE -ID:/Qt/5.9.8/msvc2017_64/include/QtCore -I. -I"D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include" -I"D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"D:\Windows Kits\10\include\10.0.18362.0\ucrt" -I"D:\Windows Kits\10\include\10.0.18362.0\shared" -I"D:\Windows Kits\10\include\10.0.18362.0\um" -I"D:\Windows Kits\10\include\10.0.18362.0\winrt" -I"D:\Windows Kits\10\include\10.0.18362.0\cppwinrt" ..\AOISystem\mainwindow.h -o debug\moc_mainwindow.cpp
    	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\AOISystem.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I..\AOISystem -I. -ID:\Qtlibs\EDSDK_64\Header -ID:\Qt\5.9.8\msvc2017_64\include -ID:\Qt\5.9.8\msvc2017_64\include\QtWidgets -ID:\Qt\5.9.8\msvc2017_64\include\QtGui -ID:\Qt\5.9.8\msvc2017_64\include\QtANGLE -ID:\Qt\5.9.8\msvc2017_64\include\QtCore -Idebug -I. -ID:\Qt\5.9.8\msvc2017_64\mkspecs\win32-msvc -Fodebug\ @C:\Users\17suo\AppData\Local\Temp\moc_mainwindow.obj.332.297.jom
    moc_mainwindow.cpp
    	link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\AOISystem.exe @C:\Users\17suo\AppData\Local\Temp\AOISystem.exe.332.1016.jom
    mainwindow.obj : error LNK2019: unresolved external symbol "private: void __cdecl MainWindow::init_EDSK(void)" (?init_EDSK@MainWindow@@AEAAXXZ) referenced in function "public: __cdecl MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QEAA@PEAVQWidget@@@Z)
    debug\AOISystem.exe : fatal error LNK1120: 1 unresolved externals
    jom: C:\Users\17suo\Documents\build-AOISystem-Desktop_Qt_5_9_8_MSVC2017_64bit-Debug\Makefile.Debug [debug\AOISystem.exe] Error 1120
    jom: C:\Users\17suo\Documents\build-AOISystem-Desktop_Qt_5_9_8_MSVC2017_64bit-Debug\Makefile [debug] Error 2
    09:52:01: The process "D:\Qt\Tools\QtCreator\bin\jom.exe" exited with code 2.
    Error while building/deploying project AOISystem (kit: Desktop Qt 5.9.8 MSVC2017 64bit)
    The kit Desktop Qt 5.9.8 MSVC2017 64bit has configuration issues which might be the root cause for this problem.
    When executing step "Make"
    09:52:01: Elapsed time: 00:01.
    

    0_1557971480059_5fbbfa7f-7947-41e3-9616-98ec8247807a-image.png


  • Qt Champions 2018

    @DaTranShan

    before any further investigation:

    The kit Desktop Qt 5.9.8 MSVC2017 64bit has configuration issues which might be the root cause for this problem. When executing step "Make"

    Which errors are shown in Tools > Options > Kits for this Kit?

    and tried to run qtcreator as administrator

    You should never do this. this can bring your system in a totally unuseable state.

    Regards


  • Qt Champions 2018

    And another important question:

    Do you have a function implementation for void MainWindow::init_EDSK(void) in your .cpp file? Does it exactly matcht the declaration in the header file?

    Regards



  • @aha_1980 thanks you so much. I implement void init_EDSK() at mainwindow.cpp but didn't implement
    void MainWindow::init_EDSK() . That's the reason. I'm really sorry about that. Thank you so much


  • Qt Champions 2018

    Hi @DaTranShan,

    glad you solved it and thanks for reporting back.

    Nevertheless, you should check your kits.

    Regards



  • @aha_1980 Thanks for your reminding. Could help me check out that?
    0_1557985405695_6da0a29e-df93-473e-af40-f26814d38a49-image.png


  • Qt Champions 2018

    @DaTranShan

    So far it looks good, I see no warning signs or such.

    Do you get a tooltip if you hover "Desktop Qt 5.9.8 MSVC2017 64bit (default)" ?

    Otherwise I think you can just ignore the message (could be a false positive).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.