Results 1 to 4 of 4

Thread: Linking to windows libs failure

  1. #1
    Join Date
    Sep 2015
    Posts
    15
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    2

    Default Linking to windows libs failure

    Hi All,
    In my project I am trying to link to the libs Imm32.lib, Winmm.lib, ws2_32.lib and User32.lib but I can't seem to make it work.
    any idea what I'm doing wrong?

    .PRO:
    Qt Code:
    1. INCLUDEPATH += "C:\\OpenCV-2.4.11\\opencv\\build\\include" \
    2. "C:\\OpenCV-2.4.11\\opencv\\build\\include\\opencv" \
    3. "C:\\OpenCV-2.4.11\\opencv\\build\\include\\opencv2" \
    4. "C:\\Program Files (x86)\\Cypress\\EZ-USB FX3 SDK\\1.3\\library\\cpp\\inc" \
    5. "C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.1A\\Include"
    6.  
    7. CONFIG(debug, debug | release) {
    8. LIBS += -L"C:\\OpenCV-2.4.11\\opencv\\build\\x86\\vc10\\lib" \
    9. -lopencv_core2411d \
    10. -lopencv_highgui2411d \
    11. -lopencv_imgproc2411d \
    12. -lopencv_features2d2411d
    13. LIBS += -L"C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.1A\\Lib\\x86" \
    14. -limm32 \
    15. -lwinmm \
    16. -lws2_32 \
    17. -luser32
    18. LIBS += -L"C:\\Program Files (x86)\\Cypress\EZ-USB FX3 SDK\\1.3\\library\cpp\\lib\\x64\\CyAPI.lib" \
    19. }
    20.  
    21. CONFIG(release, debug | release) {
    22. LIBS += -L"C:\\OpenCV-2.4.11\\opencv\\build\\x86\\vc10\\lib" \
    23. -lopencv_core2411 \
    24. -lopencv_highgui2411 \
    25. -lopencv_imgproc2411 \
    26. -lopencv_features2d2411
    27. LIBS += -L"C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.1A\\Lib\\x86" \
    28. -limm32 \
    29. -lwinmm \
    30. -lws2_32 \
    31. -luser32
    32. LIBS += -L"C:\\Program Files (x86)\\Cypress\\EZ-USB FX3 SDK\\1.3\\library\cpp\\lib\\x64\\CyAPI.lib"
    33. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Linking to windows libs failure

    What doesn't work about it?

    You seem to trying to build a generic Win32 application with no Qt components. If that is the case you may as well use the Visual Studio tools directly.

  3. #3
    Join Date
    Sep 2015
    Posts
    15
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    2

    Default Re: Linking to windows libs failure

    I have a generic Win32 application that I'm trying to embed (with tweaks) into a QT application.
    Specifically I need to incorporate the Cypress USB Library CyAPI library but get linkage errors such as:
    Qt Code:
    1. camera.obj:-1: error: LNK2019: unresolved external symbol "public: bool __thiscall CCyUSBEndPoint::XferData(unsigned char *,long &,class CCyIsoPktInfo *)" (?XferData@CCyUSBEndPoint@@QAE_NPAEAAJPAVCCyIsoPktInfo@@@Z) referenced in function "public: bool __thiscall Camera::SendDataToRegister(int,int)" (?SendDataToRegister@Camera@@QAE_NHH@Z)
    To copy to clipboard, switch view to plain text mode 

    From what I was able to gather I need those Win32 libraries to solve these errors, hence my current predicament.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Linking to windows libs failure

    You are directing the linker to the 64-bit "../lib/x64/" version of the USB library and 32-bit versions of Windows API and OpenCV. These need to match the bit-ness of your program.

    Do yourself a favour and change all the "\\" in PRO file paths to "/" and improve the reability.
    I would also consider commenting out the Windows SDK stuff until you are certain they are needed.

Similar Threads

  1. Qt 5 build : qtlocation linking failure
    By faizol in forum Installation and Deployment
    Replies: 1
    Last Post: 11th October 2012, 04:22
  2. Linking sqlite3 libs under windows.
    By bred in forum Newbie
    Replies: 1
    Last Post: 27th October 2010, 08:13
  3. jom / Windows SDK libs linking problem
    By nooky59 in forum Qt Tools
    Replies: 3
    Last Post: 12th November 2009, 14:58
  4. Linking against different Libs
    By AlphaWolf in forum Qt Programming
    Replies: 3
    Last Post: 10th February 2009, 15:25
  5. Failure to build Debug libs - Vista Mingw Qt 4.3.2
    By pmabie in forum Installation and Deployment
    Replies: 8
    Last Post: 15th October 2007, 18:04

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
  •  
Qt is a trademark of The Qt Company.