Discussion:
[Mingw-cross-env-list] Compiling problem
Markus
2018-03-02 15:15:32 UTC
Permalink
According to <https://github.com/mxe/mxe/issues/1942>
https://github.com/mxe/mxe/issues/1942 I really have to fix the library path
with -L

Would someone be so nice to explain me how to do that?

My bash looks like:



#!/bin/bash

MXE_INCLUDE_PATH=/mnt/mxe/usr/i686-w64-mingw32.static/include

MXE_LIB_PATH=/mnt/mxe/usr/i686-w64-mingw32.static/lib



i686-w64-mingw32.static-qmake-qt5 \

BOOST_LIB_SUFFIX=-mt \

BOOST_THREAD_LIB_SUFFIX=_win32-mt \

BOOST_INCLUDE_PATH=$MXE_INCLUDE_PATH/boost \

BOOST_LIB_PATH=$MXE_LIB_PATH \

OPENSSL_INCLUDE_PATH=$MXE_INCLUDE_PATH/openssl \

OPENSSL_LIB_PATH=$MXE_LIB_PATH \

BDB_INCLUDE_PATH=$MXE_INCLUDE_PATH \

BDB_LIB_PATH=$MXE_LIB_PATH \

MINIUPNPC_INCLUDE_PATH=$MXE_INCLUDE_PATH \

MINIUPNPC_LIB_PATH=$MXE_LIB_PATH \


QMAKE_LRELEASE=/mnt/mxe/usr/i686-w64-mingw32.static/qt5/bin/lrelease
coin-qt.pro



make -f Makefile.Release



Error message:



/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find
-lboost_thread-mgw46-mt-sd-1_53

/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find
-lboost_system-mgw46-mt-sd-1_53

/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find
-lboost_filesystem-mgw46-mt-sd-1_53

/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find
-lboost_program_options-mgw46-mt-sd-1_53

/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find
-lboost_chrono-mgw46-mt-sd-1_53

collect2: error: ld returned 1 exit status

make: *** [release/Eryllium-qt.exe] Error 1



Thanks!!!
Tony Theodore
2018-03-04 10:31:35 UTC
Permalink
Hi Markus,
According to https://github.com/mxe/mxe/issues/1942 I really have to fix the library path with -L
Would someone be so nice to explain me how to do that?
[…]
i686-w64-mingw32.static-qmake-qt5 \
BOOST_LIB_SUFFIX=-mt \
BOOST_THREAD_LIB_SUFFIX=_win32-mt \
BOOST_INCLUDE_PATH=$MXE_INCLUDE_PATH/boost \
BOOST_LIB_PATH=$MXE_LIB_PATH \
[…]
/mnt/mxe/usr/bin/i686-w64-mingw32.static-ld: cannot find -lboost_thread-mgw46-mt-sd-1_53
The problem may not be the `-L` setting, it’s more likely that the `coin-qt.pro` file has
the boost lib names hard-coded (maybe as an example) and isn’t picking up the `BOOST_*`
variables correctly. It should be looking for (e.g.) `-lboost_thread_win32-mt`.


In the #1492 issue, I thought the goal was to link an external build of boost but it seems
you are trying to use the MXE libs in their standard locations - `qmake` should pick these
up by default.

Can you post the `coin-qt.pro` file (or a link to the project repo)?

Cheers,

Tony
Tony Theodore
2018-03-04 11:38:36 UTC
Permalink
Hi Tony.
https://github.com/librexcoin/librexcoin/blob/master/librexcoin-qt.pro
There’s nothing obvious there, something in your environment or config is
setting `mgw46-mt-sd-1_53`, just search for `mgw46` and delete all references.


Cheers,

Tony
Tony Theodore
2018-03-04 12:11:09 UTC
Permalink
Post by Tony Theodore
Hi Tony.
https://github.com/librexcoin/librexcoin/blob/master/librexcoin-qt.pro
There’s nothing obvious there, something in your environment or config is
setting `mgw46-mt-sd-1_53`, just search for `mgw46` and delete all references.
For example, delete a line like this:

https://github.com/Eryllium/project/blob/2515fc3cfe9137d532b3df0eb1d3c373e66ccbac/qt.pro#L32
LIBS += -lboost_system-mgw46-mt-sd-1_53 -lboost_filesystem-mgw46-mt-sd-1_53 -lboost_program_options-mgw46-mt-sd-1_53 -lboost_thread-mgw46-mt-sd-1_53

because the `+=` will append those hard-coded libs even though the correct ones are added later:

https://github.com/Eryllium/project/blob/2515fc3cfe9137d532b3df0eb1d3c373e66ccbac/qt.pro#L506
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX

Cheers,

Tony

Loading...