Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [win32, MinGW] Qt5 does not find external libraries that works in Qt4
Qt 6.11 is out! See what's new in the release blog

[win32, MinGW] Qt5 does not find external libraries that works in Qt4

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 940 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sylvaticus
    wrote on last edited by
    #1

    Hello, I do my main development in Linux and time to time (years) I do a compilation in Windows.

    In my windows machine I had Qt 4.8 with gcc 4.6. I compiled, long time ago and using gcc 4.6, some external libraries and my old code works fine.
    Now I wanted to compile in windows my new code, that in the meantime has been ported to Qt5.
    So in the windows machine I installed, in an other folder, Qt5, that now comes shipped directly each version of Qt with its own MinGW. For example I have Qt5.2.1 with its DOS prompt set to work with gcc 4.8.

    My project uses some external libraries that have been compiled from source in windows using gcc 4.6 (and it was a mess, so I would really like to avoid to recompile them if possible).

    My qt project file instructs the linker to use them with the following lines:

     win32 {
        INCLUDEPATH += win32/include/coin
        INCLUDEPATH += win32/include/coin/ThirdParty
        INCLUDEPATH += win32/include
        INCLUDEPATH += win32/include/adolc
        INCLUDEPATH += $$[QT_INSTALL_DATA]/src/3rdparty/zlib
        LIBS += -L win32/lib -lipopt
        LIBS += -L win32/lib -lcoinmetis
        LIBS += -L win32/lib -lcoinmumps
        LIBS += -L win32/lib -lcoinhsl
        LIBS += -L win32/lib -lcoinblas
        LIBS += -L win32/lib -lcoinlapack
        LIBS += -L win32/lib -ladolc
        LIBS += -lpthread -lgfortran -lcoinmetis -lcoinblas
        CONFIG += exceptions
     }
    

    The problem is that when I run make, I got, in Qt5, the ld error "cannot find -lcoinmumps" (and the other libraries) and "cannot find win32/lib: Permission denied"

    When I run the old software, with the same configuration and using the Qt4 prompt, I don't have instead any linking problem.

    Could it be a different way of including external libraries in a project in Qt5 compared to Qt4 (e.g. a different location? But I tried also using the full path in the project file and I still have the permission denied problem)? Or because the external libraries have been compiled with gcc 4.6 and are hence not recognised by the gcc 4.8 used with the new Qt5 ??

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Two things:

      1. there's no space between -L and the path
      2. repeating win32/lib so many times doesn't help

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved