|
From: | John D |
Subject: | RE: mxe-build: undefined references |
Date: | Sat, 15 Mar 2014 07:40:40 -0400 |
From: Michael Goffioul [mailto:address@hidden On Fri, Mar 14, 2014 at 4:14 PM, John D <address@hidden> wrote:
Dynamic linking is different in Win32 than in Linux. You only need to link against the libraries your code is really using. You don't need to link against the deps of a DLL if your own code doesn't make any calls from those deps. The calls that the DLL makes into those deps have already been resolved when the DLL was linked. This different behavior has several consequences: - you cannot have undefined references at link time; something that is allowed under Linux - you cannot override (at least it's far from trivial) symbols from a DLL, such that it's used by all other DLL that links to your code and to that DLL; typical example in octave is override XERBLA from the BLAS DLL, by using octave's version: this doesn't work in Win32
Technically it's correct. The opengl32 is a private library that is only needed when you want to link QtOpenGL itself (that's the meaning of libs.private). If your code only uses symbols from QtOpenGL and do not make any OpenGL call, you don't need to link against opengl32. Obviously, your code would be useless, but still link-able in Win32. Michael. I haven’t tried running it yet, but I built ok using gui-release changeset 18557:ca1648b2e673 on my mxe build. At the line where it is complaining about undefines mine is: libtool: link: i686-w64-mingw32-g++ -shared -nostdlib /home/jade/mxe-octave/usr/lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib/dllcrt2.o /home/jade/mxe-octave/usr/lib/gcc/i686-w64-mingw32/4.8.2/crtbegin.o -Wl,--whole-archive qterminal/.libs/libqterminal.a src/.libs/libgui-src.a graphics/.libs/libgui-graphics.a -Wl,--no-whole-archive -L/home/jade/mxe-octave/tmp-octave/octave-3.9.0+/.build/liboctave/.libs -L/home/jade/mxe-octave/usr/i686-w64-mingw32/lib ../libinterp/.libs/liboctinterp.dll.a -L/home/jade/mxe-octave/usr/mingw/lib -L/home/jade/mxe-octave/usr/lib/gcc/i686-w64-mingw32/4.8.2 /home/jade/mxe-octave/tmp-octave/octave-3.9.0+/.build/liboctave/.libs/liboctave.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libhdf5.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libfontconfig.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libexpat.dll.a -lfreetype -lopengl32 -lglu32 -lgl2ps ../liboctave/.libs/liboctave.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libcurl.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libidn.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libintl.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libssh2.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libgcrypt.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libgpg-error.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libgnutls.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libiconv.dll.a -lnettle -lhogweed /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libgmp.dll.a -lcrypt32 /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libpcreposix.dll.a -lwldap32 -lz -lcholmod -lumfpack -lamd -lcamd -lcolamd -lccolamd -lcxsparse -larpack /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libqrupdate.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libfftw3.dll.a /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libfftw3f.dll.a -llapack -lblas -lreadline -ltermcap /home/jade/mxe-octave/usr/i686-w64-mingw32/lib/libpcre.dll.a /home/jade/mxe-octave/usr/lib/gcc/i686-w64-mingw32/4.8.2/libgfortran.dll.a /home/jade/mxe-octave/usr/lib/gcc/i686-w64-mingw32/4.8.2/libquadmath.dll.a -lQtNetwork4 -lQtOpenGL4 -lQtGui4 -lQtCore4 -lqscintilla2 -luser32 -lkernel32 -lgdi32 -lws2_32 -luser32 -lkernel32 -L/home/jade/mxe-octave/usr/lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib/../lib -L/home/jade/mxe-octave/usr/lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/lib /home/jade/mxe-octave/usr/lib/gcc/i686-w64-mingw32/4.8.2/libstdc++.dll.a -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt /home/jade/mxe-octave/usr/lib/gcc/i686-w64-mingw32/4.8.2/crtend.o -mieee-fp -O2 -pthread -Wl,-rpath-link -Wl,/home/jade/mxe-octave/usr/i686-w64-mingw32/lib -Wl,--export-all-symbols -pthread -o .libs/liboctgui-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/liboctgui.dll.a |
[Prev in Thread] | Current Thread | [Next in Thread] |