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: [EMAIL PROTECTED] [mailto:cmake- > [EMAIL PROTECTED] On Behalf Of Cristian Adam > Sent: Wednesday, May 17, 2006 2:22 PM > To: cmake@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 > [EMAIL PROTECTED] 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@cmake.org > http://www.cmake.org/mailman/listinfo/cmake _______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake