[Marble-devel] Review Request 117815: main() entry point for Visual Strudio

Dennis Nienhüser earthwings at gentoo.org
Thu May 1 00:26:28 UTC 2014



> On April 29, 2014, 4:18 p.m., Dennis Nienhüser wrote:
> > Can you elaborate a bit, please? What's the problem, what is the effect of the change?
> 
> Aleksei Aleshin wrote:
>     The problem is described on bug's page. Shortly, marble-qt.exe linking failes with error
>     "unresolved external symbol WinMain referenced in function __tmainCRTStartup"
>     
>     This change forces Visual Studio to use main() as entry point.

Right, I missed the link to the bug report. Would the following approach work as well?

diff --git a/src/apps/marble-qt/CMakeLists.txt b/src/apps/marble-qt/CMakeLists.txt
index fcb7843..b62e9ef 100644
--- a/src/apps/marble-qt/CMakeLists.txt
+++ b/src/apps/marble-qt/CMakeLists.txt
@@ -15,6 +15,9 @@ marble_qt4_automoc(${marble_SRCS})
 
 if (WIN32)
     add_executable (marble-qt WIN32 ${marble_SRCS})
+    if (MSVC)
+      set(CMAKE_CREATE_WIN32_EXE "/SUBSYSTEM:WINDOWS /ENTRY:\"mainCRTStartup\"")
+    endif()
 else (WIN32)
     if (APPLE)
         add_executable (marble-qt ${marble_SRCS})


Might also need to remove the WIN32 flag in the add_executable call. If that works I'd prefer that one since it keeps the code readable.


- Dennis


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117815/#review56916
-----------------------------------------------------------


On April 28, 2014, 4:19 a.m., Aleksei Aleshin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117815/
> -----------------------------------------------------------
> 
> (Updated April 28, 2014, 4:19 a.m.)
> 
> 
> Review request for Marble.
> 
> 
> Bugs: 333765
>     http://bugs.kde.org/show_bug.cgi?id=333765
> 
> 
> Repository: marble
> 
> 
> Description
> -------
> 
> Changes entry point to 
> int main(int argc, char *argv[])
> 
> 
> Diffs
> -----
> 
>   src/apps/marble-qt/qtmain.cpp 6e69b77 
> 
> Diff: https://git.reviewboard.kde.org/r/117815/diff/
> 
> 
> Testing
> -------
> 
> Compilation succeeded.
> 
> 
> Thanks,
> 
> Aleksei Aleshin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20140501/850d373f/attachment.html>


More information about the Marble-devel mailing list