Question

I am attempting to cross-compile Qt5 with Mingw-w64's 32-bit compiler. The host platform is Ubuntu 12.10 64-bit and the target platform is 32-bit Windows. I've managed to cross-compile the OpenSSL library and installed the cross-compiled binaries / libraries / includes to ~/i686-w64-mingw32.

The problem surfaces when I attempt to configure Qt. I am using the following command:

PKG_CONFIG_PATH=~/i686-w64-mingw32/lib/pkgconfig ./configure -prefix \
  ~/i686-w64-mingw32 -opensource -confirm-license -release -nomake demos \
  -nomake examples -xplatform win32-g++ -device-option \
  CROSS_COMPILE=i686-w64-mingw32-

The qmake binary compiles successfully for the host platform, and a list of all enabled features is displayed:

...
ODBC support ........... plugin
SQLite support ......... plugin (qt)
OpenSSL support ........ no

What's going on here? It seems like Qt somehow can't find the OpenSSL includes. Turning on the -v flag during the configuration process confirms this - I get some error about not being able to find openssl/opensslv.h.

So my next step was to confirm that pkg-config was indeed working:

PKG_CONFIG_PATH=~/i686-w64-mingw32/lib/pkgconfig pkg-config --libs openssl

And it appeared to be:

-L/home/nathan/i686-w64-mingw32/lib -lssl -lcrypto

So how can I convince Qt that I have OpenSSL libraries available? I've tried the -force-pkg-config flag, but it made no difference.

Était-ce utile?

La solution

After asking in the #qt channel on Freenode, I was able to finally come up with a working solution.

Instead of trying to get the ./configure script to use pkg-config, I needed to pass the compiler options directly to ./configure. So the command looks something like this:

./configure <...> -I~/i686-w64-mingw32/include

The compiler was then able to find the headers and enable runtime OpenSSL support.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top