Results 1 to 6 of 6

Thread: Lnk 2019

  1. #1
    Join Date
    Dec 2012
    Posts
    17
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Lnk 2019

    Hi friends

    I have been trying to add a library into my project. My project file looks like this :

    Qt Code:
    1. QT += core gui
    2. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    3.  
    4. TARGET = sdk2
    5. TEMPLATE = app
    6.  
    7.  
    8.  
    9. SOURCES += main.cpp\
    10. mainwindow.cpp
    11.  
    12. HEADERS += mainwindow.h \
    13. ../../../../../SDKstudy/Runtime5.1/include/fgrab_struct.h \
    14. ../../../../../SDKstudy/Runtime5.1/include/fgrab_prototyp.h \
    15. ../../../../../SDKstudy/Runtime5.1/include/fgrab_define.h
    16.  
    17. INCLUDEPATH += $$PWD/../../../../../SDKstudy/Runtime5.1\include
    18. DEPENDPATH += $$PWD/../../../../../SDKstudy/Runtime5.1\include
    19.  
    20.  
    21. INCLUDEPATH += C:\Users\Alok\SDKstudy\Runtime5.1\dll\mE4AD1-CL
    22. DEPENDPATH += C:\Users\Alok\SDKstudy\Runtime5.1\dll\mE4AD1-CL
    23.  
    24.  
    25. FORMS += mainwindow.ui
    26.  
    27.  
    28.  
    29. LIBS += -L$$PWD/../../../../../SDKstudy/Runtime5.1/lib/visualc2005_amd64/ -lfglib5
    30.  
    31. INCLUDEPATH += $$PWD/../../../../../SDKstudy/Runtime5.1/lib/visualc2005_amd64
    32. DEPENDPATH += $$PWD/../../../../../SDKstudy/Runtime5.1/lib/visualc2005_amd64
    To copy to clipboard, switch view to plain text mode 

    When i try to run the code i get the following error

    main.obj:-1: error: LNK2019: unresolved external symbol _Fg_Init referenced in function _main


    Can you please help me resolve this.



    Many thanks

    Regards
    Alok

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Lnk 2019

    Are you sure $PWD is pointing to the right directory so that the "../../../" are right? Try to use absolute paths to see if the error still remains.

  3. #3
    Join Date
    Dec 2012
    Posts
    17
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Lnk 2019

    Hi Lykurg

    I tried using absolute path as well. The error persists still

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Lnk 2019

    Ok, why do you have e.g. "../../../../../SDKstudy/Runtime5.1/include/fgrab_struct.h" in the HEADERS variable? And how does your main function look like?

  5. #5
    Join Date
    Dec 2012
    Posts
    17
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Lnk 2019

    what I did was right clicked on project and clicked on add existing libraries. These syntaxes gets written when we complete adding libraries.


    My Main function looks like this :

    Qt Code:
    1. #include "mainwindow.h"
    2. #include <stdio.h>
    3. #include <QApplication>
    4.  
    5. #include"fgrab_define.h"
    6. #include "fgrab_prototyp.h"
    7. #include "fgrab_struct.h"
    8.  
    9. using namespace std;
    10.  
    11. #define DLLNAME "DualAreaGray16.dll"
    12.  
    13. int main(int argc, char *argv[])
    14. {
    15. QApplication a(argc, argv);
    16. Fg_Struct *fg = NULL;
    17.  
    18. fg = Fg_Init(DLLNAME, PN_MICROENABLE4AD1CL ); //function defined in library
    19.  
    20. return a.exec();
    21. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jul 2016
    Posts
    1
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Windows

    Default Re: Lnk 2019

    Hey how did you solve your problem ? I'm stuck on the same thing

Similar Threads

  1. Linker error 2019: Opencv 2.3 and qt 4.7.4
    By lakskant in forum Qt Programming
    Replies: 3
    Last Post: 30th May 2012, 11:04
  2. LNK 2019 Error while compiling qt program in VS2008
    By mevkurray in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 7th February 2010, 00:29
  3. 2019 linker error
    By bmn in forum Newbie
    Replies: 10
    Last Post: 29th July 2008, 00:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.