[CMake] qt4 simple app
Moreland, Kenneth
kmorel at sandia.gov
Fri May 19 15:31:00 EDT 2006
The QT_QTMAIN_LIBRARY and QT_USE_QTMAIN variables are broken as of CMake
2.4.1. They should be fixed on the trunk and when CMake 2.4.2 is
released.
-Ken
> -----Original Message-----
> From: cmake-bounces+kmorel=sandia.gov at cmake.org [mailto:cmake-
> bounces+kmorel=sandia.gov at cmake.org] On Behalf Of Cristian Adam
> Sent: Wednesday, May 17, 2006 2:22 PM
> To: cmake at cmake.org
> Subject: [CMake] qt4 simple app
>
> Hi all,
>
> I'm trying to compile a simple Qt4 (4.1.1) application with Visual
> Studio 7 .NET 2003, but I get this error:
> Linking...
> MSVCRT.lib(crtexew.obj) : error LNK2019: unresolved external symbol
> _WinMain at 16 referenced in function _WinMainCRTStartup
>
> Here is my CMakeLists.txt file:
>
> SET(QT_USE_QTMAIN TRUE)
> INCLUDE (${CMAKE_ROOT}/Modules/FindQt4.cmake)
>
> INCLUDE_DIRECTORIES(
> ${QT_INCLUDES}
> )
>
> LINK_DIRECTORIES(
> ${QT_LIBRARY_DIR}
> )
>
> IF(NOT QT_LIBRARIES)
> SET(QT_LIBRARIES
> ${QT_QTCORE_LIBRARY}
> ${QT_QTGUI_LIBRARY}
> ${QT_QTMAIN_LIBRARY}
> )
> ENDIF(NOT QT_LIBRARIES)
>
> ADD_EXECUTABLE(main WIN32 main.cpp)
> TARGET_LINK_LIBRARIES(main ${QT_LIBRARIES})
>
> If I compile the same application with MinGW with Qt4 (4.1.2)
everything
> compiles just fine.
>
> Also if I set qtmain.lib instead ${QT_QTMAIN_LIBRARY} everyting
compiles
> just fine, but I don't like this hack, also I think that setting
> QT_LIBRARIES by hand is a hack.
>
> Somehow SET(QT_USE_QTMAIN TRUE) is ignored for Visual Studio 7 .NET
2003.
>
> Any ideas?
>
> Regards,
> Cristi.
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
More information about the CMake
mailing list