[Insight-users] Annoying console window for Qt + ITK + CMake
Pavan Podila
pavan.podila at gmail.com
Wed Jan 19 15:04:33 EST 2005
Thanks Bill,
Finally it helped!!! Although VS.NET still compalains about a
conflict with the msvcrt.lib
"MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib'
conflicts with use of other libs; use /NODEFAULTLIB:library
"
I hope it's not a major problem. I am attaching the complete
CMakeLists.txt file for the QtItk example, which works well. I hope
others will find it useful.
thanks again.
Pavan
-------------------------------------------------------------
PROJECT(QtITKExample)
FIND_PACKAGE(ITK)
IF(ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
MESSAGE(FATAL_ERROR
"Cannot build InsightApplications without ITK. Please set ITK_DIR.")
ENDIF(ITK_FOUND)
#
# Find QT
#
FIND_PACKAGE(Qt)
INCLUDE_DIRECTORIES(
${QT_INCLUDE_DIR}
${QT_INCLUDE_PATH}
)
LINK_LIBRARIES (
ITKIO
${QT_LIBRARIES}
)
IF(WIN32)
LINK_LIBRARIES(
${QT_QTMAIN_LIBRARY}
)
ADD_DEFINITIONS(-DQT_DLL)
ENDIF(WIN32)
SET(QtITK_SRCS
itkQtProgressBar.cxx
qtITK.cxx
)
SET(QtITK_MOC_SRCS
itkQtAdaptor.h
itkQtLightIndicator.h
)
IF(QT_WRAP_CPP)
QT_WRAP_CPP(QtITK QtITK_SRCS QtITK_MOC_SRCS)
ENDIF(QT_WRAP_CPP)
ADD_EXECUTABLE(QtITK WIN32 QtITK_SRCS)
-------------------------------------------------------------
William A. Hoffman wrote:
>See this message:
>
>http://public.kitware.com/pipermail/cmake/2004-June/005177.html
>looks like you have to link to qtmain.lib
>
>-Bill
>
>At 02:34 PM 1/19/2005, Pavan Podila wrote:
>
>
>>HI,
>> Recently I have switched from qmake to CMake. I was successful in compiling and running my application. However I get this annoying console window which I want to get rid of somehow. I tried the Win32 flag in ADD_EXECUTABLE() but then the VS.NET complains about not finding the WinMain().
>> Earlier with qmake I never had this problem. Is there a way to hide this console window. We will be deploying this application on the client-side, so its important that we get rid of the console window. I strongly want to use CMake instead of qmake.
>>
>>Kindly help,
>>Pavan
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk.org
>>http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>
>
>
>
More information about the Insight-users
mailing list