Results 1 to 9 of 9

Thread: MinGW can't find my libraries

  1. #1
    Join Date
    Sep 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Post MinGW can't find my libraries

    Hi,

    I'm trying to compile qxmpp libraries with qtcreator 2.3.0. I believe the problem occurs at the linking stage, here is the relative output:

    Qt Code:
    1. g++ -Wl,-s -Wl,-subsystem,console -o release\tests.exe release/tests.o release/moc_tests.o release/qrc_tests.o -L"c:\qt-everywhere-opensource-src-4.7.4\lib" -LE:/qxmpp-0.3.0/lib -lqxmpp -lQtTest -lQtXml -lQtGui -lQtNetwork -lQtCore gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib winspool.lib msimg32.lib c:\qt-everywhere-opensource-src-4.7.4\lib\QtCore.lib kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib advapi32.lib ws2_32.lib /LIBPATH:C:\OpenSSL-Win32\lib
    2. mingw32-make[2]: Leaving directory `E:/qxmpp-build-desktop-Qt_4_7_4__qt-everywhere-opensource-src-4_7_4__Release/tests'
    3. mingw32-make[1]: Leaving directory `E:/qxmpp-build-desktop-Qt_4_7_4__qt-everywhere-opensource-src-4_7_4__Release/tests'
    4. g++: gdi32.lib: No such file or directory
    5. g++: comdlg32.lib: No such file or directory
    6. g++: oleaut32.lib: No such file or directory
    7. g++: imm32.lib: No such file or directory
    8. g++: winmm.lib: No such file or directory
    9. g++: winspool.lib: No such file or directory
    10. g++: msimg32.lib: No such file or directory
    11. g++: kernel32.lib: No such file or directory
    12. g++: user32.lib: No such file or directory
    13. g++: shell32.lib: No such file or directory
    14. g++: uuid.lib: No such file or directory
    15. g++: ole32.lib: No such file or directory
    16. g++: advapi32.lib: No such file or directory
    17. g++: ws2_32.lib: No such file or directory
    18. g++: /LIBPATH:C:\OpenSSL-Win32\lib: No such file or directory
    19. mingw32-make[2]: *** [release\tests.exe] Error 1
    20. mingw32-make[1]: *** [release] Error 2
    21. mingw32-make: *** [sub-tests-make_default-ordered] Error 2
    22. The process "C:\Qt\qtcreator-2.3.0\mingw\bin\mingw32-make.exe" exited with code 2.
    23. Error while building project qxmpp (target: Desktop)
    24. When executing build step 'Make'
    To copy to clipboard, switch view to plain text mode 

    I copied the Microsoft SDK lib files to the qt's lib directory but it still can't find them. It also can't find the openssl libraries even though the path seen after LIBPATH is correct.

    Any suggestions?

    Thanks...

  2. #2
    Join Date
    Aug 2011
    Posts
    44
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60

    Default Re: MinGW can't find my libraries

    How do you add gdi32 in .pro file?

  3. #3
    Join Date
    Sep 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: MinGW can't find my libraries

    Quote Originally Posted by llev View Post
    How do you add gdi32 in .pro file?
    Thanks for answering, I tried these:

    LIBS += "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib"
    LIBS += -L"C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib" -gdi32
    LIBS += "C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0A\\Lib"

    None of them worked. Do I have to explicitly add them in the pro file? Shouldn't QtCreator find them itself?

  4. #4
    Join Date
    Aug 2011
    Posts
    44
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60

    Default Re: MinGW can't find my libraries

    Try to replace it with the lines like this:
    LIBS += -lgdi32 -lcomdlg32
    etc.
    Then rebuild the project and check how linker errors changed.

  5. #5
    Join Date
    Sep 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: MinGW can't find my libraries

    Didn't work. Tried

    Qt Code:
    1. LIBS += -lgdi32 ...
    To copy to clipboard, switch view to plain text mode 

    and

    Qt Code:
    1. LIBS += +Lc:\\lib #ms sdk lib files are here
    2. LIBS += -lgdi32 ...
    To copy to clipboard, switch view to plain text mode 
    .

    It still can't find them.

  6. #6
    Join Date
    Aug 2011
    Posts
    44
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60

    Default Re: MinGW can't find my libraries

    Please pay attention on how qt was built.
    qt built using MinGW tools uses its own versions of standard libraries. They usually locate at lib sub-folder of MinGW root folder.
    Also MinGW tools treat "-lgdi32" record as request to link libgdi32.a file, by other words they follow linux-style naming convention.
    And, of course, qt built with MinGW should be used with MinGW build tools.

    As I understand you're using MinGW build tools.
    Correct?
    I guess qt you're using was built with MinGW too?
    If so, try to add the path to MinGW\lib folder via the line similar to the following:
    QMAKE_LIBDIR += C:/MinGW/lib
    And get back to LIBS += -lgdi32 ..

  7. #7
    Join Date
    Sep 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: MinGW can't find my libraries

    Actually I didn't have a lib folder under C:\mingw, but anyway I tried compiling the project with msvc2010 (again with qtcreator) and it compiled fine! Is there any particular reason as to why I should use mingw? Because msvc seems to be giving me less problems. I'll consider what you said when I try with mingw next.

  8. #8
    Join Date
    Aug 2011
    Posts
    44
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60

    Default Re: MinGW can't find my libraries

    I prefer to use MSVC libs and see a few reasons to use MinGW on Windows' builds.
    I told you about MinGW just because the logs in your original post show that fact you used MinGW tools to compile app.
    g++ -Wl,-s -Wl,-subsystem,console -o release\tests.exe release/tests.o release/moc_tests.o release/qrc_tests.o -L"c:\qt-everywhere-opensource-src-4.7.4\lib" -LE:/qxmpp-0.3.0/lib -lqxmpp -lQtTest -lQtXml -lQtGui -lQtNetwork -lQtCore gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib winspool.lib msimg32.lib c:\qt-everywhere-opensource-src-4.7.4\lib\QtCore.lib kernel32.lib user32.lib shell32.lib uuid.lib ole32.lib advapi32.lib ws2_32.lib /LIBPATH:C:\OpenSSL-Win32\lib
    mingw32-make[2]: Leaving directory `E:/qxmpp-build-desktop-Qt_4_7_4__qt-everywhere-opensource-src-4_7_4__Release/tests'
    mingw32-make[1]: Leaving directory `E:/qxmpp-build-desktop-Qt_4_7_4__qt-everywhere-opensource-src-4_7_4__Release/tests'
    g++: gdi32.lib: No such file or directory

  9. #9
    Join Date
    Sep 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: MinGW can't find my libraries

    Yes I was, switched to msvc later as I said. Thanks for helping.

Similar Threads

  1. Qt Creator Mingw can't find my libraries
    By cape in forum Qt Tools
    Replies: 0
    Last Post: 17th September 2011, 22:47
  2. Configure qt Libraries for Wince with mingw
    By rickrvo in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2011, 10:28
  3. Compiling errors - can't find the libraries
    By magelet in forum Newbie
    Replies: 7
    Last Post: 24th May 2010, 08:24
  4. Mingw doesn't find qt include files
    By NineTailFox in forum Newbie
    Replies: 2
    Last Post: 12th November 2008, 08:18
  5. Qt + Eclipse + MinGW + Windows: How to include libraries?
    By jambrek in forum General Programming
    Replies: 3
    Last Post: 19th December 2007, 13:57

Tags for this Thread

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.