Mingw32 link issue with Qlocalsocket and libimm32 not found



  • Have an issue when linking QT libraries. Static build of QT 5.8.0 and linking and this is the error that is received:
    checking QtPlugin usability... yes
    checking QtPlugin presence... yes
    checking for QtPlugin... yes
    checking QApplication usability... yes
    checking QApplication presence... yes
    checking for QApplication... yes
    checking QLocalSocket usability... yes
    checking QLocalSocket presence... yes
    checking for QLocalSocket... yes
    checking for main in -limm32... no
    configure: error: libimm32 not found

    Have tried everything to resolve this issue and have not found any answer. Here is the configure command used:

    CFLAGS="-march=i686 -Os -static"
    CPPFLAGS="-I/c/deps/32/db-4.8.30.NC/build_unix
    -I/usr/local/libpng\include
    -I/c/deps/32/miniupnpc
    -I/usr/local/ssl/include
    -I/usr/local/ssl/include/openssl
    -I/usr/local/protobuf/include
    -I/usr/local/qrencode/include
    -I/usr/local/libevent/include
    -I/c/boost/include/boost-1_61
    -I/c/QT/build/32/5.8.0/include
    -I/c/QT/build/32/5.8.0/include\QtNetwork
    -I/c/deps
    -I/usr/local/include"
    LDFLAGS="-L/c/deps/32/db-4.8.30.NC/build_unix
    -L/c/QT/build/32/5.8.0/plugins/platforms/libqwindows.a -lqwindows
    -L/c/mingw32/i686-w64-mingw32/lib/libwinpthread.a -lwinpthread
    -L/c/mingw32/i686-w64-mingw32/lib/libimm32.a -limm32
    -L/c/mingw32/i686-w64-mingw32/lib
    -L/usr/local/libpng/lib -lpng
    -L/usr/local/libpng/lib
    -L/usr/local/ssl/lib
    -L/usr/local/ssl/lib/libssl.a -lssl
    -L/usr/local/ssl/lib/libcrypto.a -lcrypto
    -L/c/deps/32/miniupnpc
    -L/usr/local/protobuf/lib -lprotobuf
    -L/usr/local/qrencode/lib -lqrencode
    -L/usr/local/libevent/lib -levent
    -L/usr/local/lib
    -Wl,--unresolved-symbols=ignore-all"
    LIBS="-lwinpthread -lssl -lcrypto -lprotobuf -lqrencode -lwinmm -lgdi32 -lwsock32 -lm -lpng -lws2_32 -lwinmm"
    LIBS+="-L/c/QT/build/32/5.8.0/plugins/platforms -lqwindows"
    LIBEVENT_LIBS=" -L/usr/local/libevent/lib -levent"
    LIBEVENT_CFLAGS="-I/usr/local/libevent/include"
    BOOST_ROOT=/c/boost
    ./configure
    --host=i686-w64-mingw32
    --with-boost-libdir=/c/boost/lib
    --with-boost-system=boost_system-mgw53-mt-s-1_61
    --with-boost-filesystem=boost_filesystem-mgw53-mt-s-1_61
    --with-boost-thread=boost_thread-mgw53-mt-s-1_61
    --with-boost-chrono=boost_chrono-mgw53-mt-s-1_61
    --enable-optimization=0
    --disable-upnp-default
    --disable-tests
    --without-qt
    --with-openssl
    --with-gui=qt5
    --with-zmq=yes
    --with-bench=yes
    --with-debug=no
    --with-wallet=yes
    --with-qt-incdir=/C/QT/build/32/5.8.0/include
    --with-qt-libdir=/C/QT/build/32/5.8.0/lib
    --with-qt-plugindir=/C/QT/build/32/5.8.0/plugins
    --with-qt-bindir=/C/QT/build/32/5.8.0/bin
    --with-protoc-bindir=/c/deps/protobuf-2.6.1/src

    Thanks.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Are you using the MinGW distribution provided by Qt ?



  • Thanks for replying!

    No - I am using the from mingw with the PONIX/dwarf toolchain., though I will say that the version is the same (5.3.0) - confirmed everything within the environment. I tried compiling using the mingw included, but could never get the static libraries to build - most likely because of a configuration/environment issue.


  • Lifetime Qt Champion

    Do you mean you had the same error with the MinGW provided with Qt ?



  • No - I downloaded the mingw environment and toolchain - made sure I was using the same version (5.3.0) that was bundled with 5.8.0 Everything and Installer - when I compile within the mingw environment (installed from mingw) - I am able to build static 5.8.0 libraries for QT. If I try to build using the mingw library that comes with QT, I cannot get it to compile - numerous errors. I see that 5.9.0 is available and will try compiling using that with the mingw environment included. The biggest problem is that some of the embedded libraries (ssl) conflict with the versions trying to compile outside.



  • This is the script used to create the library (run as a cmd within windows command prompt, 32 bit):

    @echo off
    rem ====================CONFIGURE BEFORE RUN SCRIPT!!======================
    set QtSrcDir=C:\QT\5.8.0\5.8\Src
    set QtStaticDir=C:\Qt\Build\32\5.8_Static
    set MingwDir=C:\QT\5.8.0\Tools\mingw530_32
    set LANG = en
    rem =======================================================================

    PATH = %MingwDir%\bin;%MingwDir%\opt\bin;C:\Perl\bin;%SystemRoot%\system32;%SystemRoot%

    set FILE_TO_PATCH=%QtSrcDir%\qtbase\mkspecs\win32-g++\qmake.conf
    echo %FILE_TO_PATCH%
    if exist %FILE_TO_PATCH%.patched goto skipPatch
    type %FILE_TO_PATCH%>%FILE_TO_PATCH%.patched
    echo.>>%FILE_TO_PATCH%
    echo QMAKE_LFLAGS += -static -static-libgcc>>%FILE_TO_PATCH%
    echo QMAKE_CFLAGS_RELEASE -= -O2>>%FILE_TO_PATCH%
    echo QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer>>%FILE_TO_PATCH%
    echo DEFINES += QT_STATIC_BUILD>>%FILE_TO_PATCH%
    :skipPatch

    set QT_INSTALL_PREFIX = %QtStaticDir%
    set OldDir=%CD%
    cd %QtSrcDir%
    cmd /C "configure.bat -static -release -platform win32-g++ -prefix %QtStaticDir% -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-sql-sqlite -no-openssl -opensource -confirm-license -make libs -make tools -nomake examples -nomake tests -no-angle"
    if ERRORLEVEL 1 goto :error

    mingw32-make -r -k -j4
    if ERRORLEVEL 1 goto :error

    mingw32-make -k install
    if ERRORLEVEL 1 goto :error

    set FILE_TO_PATCH=%QtStaticDir%\mkspecs\win32-g++\qmake.conf
    echo.>>%FILE_TO_PATCH%
    echo CONFIG += static>>%FILE_TO_PATCH%

    echo ============BUILT!============
    goto exitX
    :error
    echo ============ERROR!============
    :exitX
    pause
    cd %OldDir%


  • Lifetime Qt Champion

    For OpenSSL, ensure that you are using a version below 1.1. The 1.1 release broke compatibility with older version. There's a new backend in the making for that but it's not yet ready.



  • Thanks - will certainly try that because downloaded and tried using 5.9.0 - compiled without issue (QT) and the exact same error occurred. Will get a 1,1 version and post if this solved the issue.


  • Lifetime Qt Champion

    WARNING I wrote below 1.1 so a 1.0.X release.



  • Recompiled using Openssl 1.0.1l. (clean and make) - openssl is placed in usr/local/ssl path so no change of writing over standard library files.

    No change - the exact same error; also, pushed the 5.9.0 bin folder to be at the end of the general PATH statement:
    PATH=%PATH%;I:\QT\build\32\5.9.0\bin

    Opening MINGW environment thereafter:
    cd C:\MinGW\msys\1.0
    msys.bat

    Error:
    checking QtPlugin usability... yes
    checking QtPlugin presence... yes
    checking for QtPlugin... yes
    checking QApplication usability... yes
    checking QApplication presence... yes
    checking for QApplication... yes
    checking QLocalSocket usability... yes
    checking QLocalSocket presence... yes
    checking for QLocalSocket... yes
    checking for main in -limm32... no
    configure: error: libimm32 not found


  • Lifetime Qt Champion

    Can you add the -v option ? So you'll have more information about what is currently failing.


Log in to reply
 

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