From a6d48ca57403539ab8e00d16f80bd4cd334e1b5c Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Mon, 4 Apr 2011 13:01:48 +0200 Subject: win32-g++: Correct the order of linked Windows libraries On Windows 7, kernel32.dll exports many of the same functions as advapi32.dll. If executables link to these functions in kernel32.dll instead of advapi32.dll, running these executables on older versions of Windows will cause an entry point error. This would occur due to kernel32 being specified before advapi32. To resolve this issue, advapi32 is specified before kernel32 when linking. Task-number: QTBUG-18537 Merge-request: 1169 Reviewed-by: Oswald Buddenhagen --- mkspecs/win32-g++/qmake.conf | 2 +- qmake/Makefile.win32-g++ | 2 +- qmake/Makefile.win32-g++-sh | 2 +- qmake/qmake.pri | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index 1469abd..220af32 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -67,7 +67,7 @@ QMAKE_EXTENSION_STATICLIB = a QMAKE_LIBS = -QMAKE_LIBS_CORE = -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lws2_32 +QMAKE_LIBS_CORE = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lws2_32 -lole32 -luuid -luser32 -ladvapi32 QMAKE_LIBS_NETWORK = -lws2_32 QMAKE_LIBS_OPENGL = -lglu32 -lopengl32 -lgdi32 -luser32 diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index 29fbd0a..5a46e41 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -28,7 +28,7 @@ CFLAGS = -c -o$@ -O \ -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT CXXFLAGS = $(CFLAGS) LFLAGS = -static-libgcc -static-libstdc++ -s -LIBS = -lole32 -luuid +LIBS = -lole32 -luuid -ladvapi32 -lkernel32 LINKQMAKE = g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index 9c7942c..6ca7514 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -28,7 +28,7 @@ CFLAGS = -c -o$@ -O \ -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT CXXFLAGS = $(CFLAGS) LFLAGS = -static-libgcc -static-libstdc++ -s -LIBS = -lole32 -luuid +LIBS = -lole32 -luuid -ladvapi32 -lkernel32 LINKQMAKE = g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 8f46a2e..3a0ab12 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -135,7 +135,7 @@ bootstrap { #Qt code SOURCES += qfsfileengine_win.cpp qfsfileengine_iterator_win.cpp qsettings_win.cpp \ qsystemlibrary.cpp win32-msvc*:LIBS += ole32.lib advapi32.lib - win32-g++*:LIBS += -lole32 -luuid + win32-g++*:LIBS += -lole32 -luuid -ladvapi32 -lkernel32 } qnx { -- cgit v0.12