Bug 321802 - Linking fails with qt 4.8 on windows
Summary: Linking fails with qt 4.8 on windows
Status: RESOLVED FIXED
Alias: None
Product: trojita
Classification: Applications
Component: Other (show other bugs)
Version: git
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Trojita default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-30 21:09 UTC by OlegYch
Modified: 2013-07-12 09:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
this patch seems to fix build (1.16 KB, patch)
2013-06-30 21:13 UTC, OlegYch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description OlegYch 2013-06-30 21:09:17 UTC
I have Mingw 4.4 Qt 4.8.4 and CMake 2.8.11.1 installed.
The link step fails with a dozen of errors like this:
qwwsmtpclient.cpp:438: undefined reference to `_imp___ZNK7QString8endsWithERKS_N2Qt15CaseSensitivityE' 
full log here http://paste.debian.net/13366/

Reproducible: Always
Comment 1 OlegYch 2013-06-30 21:13:08 UTC
Created attachment 80872 [details]
this patch seems to fix build
Comment 2 Thomas Lübking 2013-06-30 21:30:38 UTC
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7971af0..4ac8397 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -631,7 +631,7 @@ if(BUILD_DESKTOP_GUI)
     target_link_libraries(trojita AppVersion Imap MSA Streams qwwsmtpclient Common Composer AbookAddressbook DesktopGui
         ${QT_QTSQL_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
     if(NOT WITH_QT5)
-        target_link_libraries(trojita MimetypesQt4)
+        target_link_libraries(trojita MimetypesQt4 ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTCORE_LIBRARY})

Try moving ${QT_QTCORE_LIBRARY} into the upper list instead and leave the NOT WITH_QT5 one untouched.
Explicitly adding ${QT_QTCORE_LIBRARY} to the linker list is reasonable but i'm not sure whether Jan is already on vacation ;-)
Comment 3 Jan Kundrát 2013-07-12 09:29:28 UTC
Git commit 033c196ec69e2603cec3a3db7f070d40829add3a by Jan Kundrát.
Committed on 12/07/2013 at 09:28.
Pushed by jkt into branch 'master'.

Fix link failure on Windows (MinGW)

Patch by "OlegYch" <olegych@tut.by> (no real name available).

M  +2    -2    CMakeLists.txt

http://commits.kde.org/trojita/033c196ec69e2603cec3a3db7f070d40829add3a