[Cmake] WinMain

Nick Arini nick.arini at amersham.com
Mon Jun 7 09:26:30 EDT 2004


Dear CMake users,


I am using CMake as the build tool for a GUI application written in Qt (on 
Linux-GCC 3.3).

When I build the application on Windows XP (MSVC++.NET 7.1) it will 
compile just fine with no errors, however when
I run the app I get the command window showing up as well as the GUI. In 
my main program I am using main().

When I replace the line:

ADD_EXECUTABLE(viewer VIEWER_SRCS)

in my CMakeLists.txt file with this:

ADD_EXECUTABLE(viewer WIN32 VIEWER_SRCS)

however, I get the following linker error:


------ Build started: Project: viewer, Configuration: Release Win32 ------

Compiling...
main.cpp
Linking...
   Creating library Release\viewer.lib and object Release\viewer.exp
MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol 
_WinMain at 16 referenced in function _WinMainCRTStartup
Release\viewer.exe : fatal error LNK1120: 1 unresolved externals

viewer - 2 error(s), 0 warning(s)


How do I get rid of the command window without making my code platform 
specific?

I am using version 1.8 patch 3 of CMake.

Thanks and best regards,

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20040607/b9fa6a2e/attachment.html


More information about the Cmake mailing list