Closed peter279k closed 3 years ago
BTW, if removing the -lresolv
(The $LIBS
environment variable), it will present following configuring error:
configure: error: res_query() not found with LIBS="-lresolv"
I'm afraid there is no libresolv for mingw32. Correct me if I'm wrong. However, there is another option: c-ares. You can switch to c-ares with --enable-cares
configure option.
There is a report that libstrophe can be built in your scenario: #159
Hi @pasis, thanks for your reply.
After I use the --enable-cares
when running ./configure
script, it's worked.
I need to cross compile the ca-res
project before crossing compiling the libstrophe
project.
Finally, above of all crossing compilation have been done. And my ./build.sh
script is as follows:
#!/bin/bash
# References: https://github.com/strophe/libstrophe/issues/159
# References: https://github.com/strophe/libstrophe/issues/172
export TOOLCHAIN=/usr
export CC=$TOOLCHAIN/bin/x86_64-w64-mingw32-gcc
export CXX=$TOOLCHAIN/bin/x86_64-w64-mingw32-g++
export AR=$TOOLCHAIN/bin/x86_64-w64-mingw32-ar
export LD=$TOOLCHAIN/bin/x86_64-w64-mingw32-ld
export RANLIB=$TOOLCHAIN/bin/x86_64-w64-mingw32-ranlib
export LDFLAGS="-L$(pwd)/../expat-2.2.10/_install/lib"
export CPPFLAGS="-I$(pwd)/../expat-2.2.10/_install/include"
export PKG_CONFIG_PATH=$(pwd)/../openssl-1.1.1i/_install/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$(pwd)/../c-ares-1.17.1/_install/lib/pkgconfig"
if [[ ! -d "$(pwd)/_install" ]]; then
mkdir "$(pwd)/_install"
fi;
./configure --host=x86_64-w64-mingw32 --prefix="$(pwd)/_install" --enable-cares --disable-shared --enable-static
make clean && make && make install
Hopefully this building file can help others that want to cross compile libstrophe
with x86_64-w64-mingw32
for Windows :).
When trying to cross compile from Linux to Windows with
x86_64-w64-mingw32
, it presents following configuring error:Reproducing issue
expat
has been built onUbuntu 18.04
for Windows.build.sh
is as follows:Can someone know about this issue? How to cross compile on Ubuntu for Windows?