mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Undefined references when using QtNetwork


From: Mark Brand
Subject: Re: [Mingw-cross-env-list] Undefined references when using QtNetwork
Date: Mon, 13 Aug 2012 18:25:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Firefox/14.0.1 SeaMonkey/2.11

Benjamin Kloster wrote:
Hi everyone,

Welcome.

I'm trying to build a Qt project depending on the QtNetwork library. The build
system is not qmake, but CMake since it needs to integrate into a larger
project. I followed the tutorial about setting up MXE and had some trouble
with both the stable and the master branch (some libraries wouldn't compile
when using just "make").

We'd like to know more about this trouble.


I decided to try and compile my project anyway, since MXE seemed to build Qt
and some of my own libraries successfully. However, upon compiling my Qt
project, I get a bunch of "undefined reference" errors seemingly related to SSL
(which I don't use yet, but will require later on). An excerpt of the error
message:

/home/ben/tools/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-
mingw32/lib/libQtNetwork.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:
(.text+0x1): undefined reference to `ASN1_INTEGER_get'
/home/ben/tools/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-
mingw32/lib/libQtNetwork.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:
(.text+0x11): undefined reference to `ASN1_STRING_data'
/home/ben/tools/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-
mingw32/lib/libQtNetwork.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:
(.text+0x21): undefined reference to `ASN1_STRING_length'
/home/ben/tools/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-
mingw32/lib/libQtNetwork.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:
(.text+0x31): undefined reference to `ASN1_STRING_to_UTF8'
/home/ben/tools/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-
mingw32/lib/libQtNetwork.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:
(.text+0x41): undefined reference to `BIO_ctrl'
/home/ben/tools/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-
mingw32/lib/libQtNetwork.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:
(.text+0x51): undefined reference to `BIO_free'
/home/ben/tools/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-
mingw32/lib/libQtNetwork.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:
(.text+0x61): undefined reference to `BIO_new'
/home/ben/tools/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-
mingw32/lib/libQtNetwork.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:
(.text+0x71): undefined reference to `BIO_new_mem_buf'
/home/ben/tools/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-
mingw32/lib/libQtNetwork.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:
(.text+0x81): undefined reference to `BIO_read'

and so on for a few more pages.

"make openssl" in the MXE directory says there's nothing to be done for
openssl, so it seems to be compiled properly. Same for Qt. So, how can I fix
this?

Because we are using static linking, it's necessary to link explicitly to the libraries that QtNetwork depends on. You can see these in the .prl files (for qmake). This is taken care of automatically when you use qmake or pkgconfig, but perhaps not when you use cmake. What does your link line look like?

Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]