当前位置: 技术问答>linux和unix
windows下的起始函数是winmain,但是qt的主函数是main,如何在windows下启动?
来源: 互联网 发布时间:2015-06-21
本文导语: 我在windows下如下代码: #include #include int main( int argc, char **argv ) { QApplication a( argc, argv ); QPushButton hello( "Hello world!", 0 ); hello.resize( 100, 30 ); a.setMainWidget( &hello ); hello.sho...
我在windows下如下代码:
#include
#include
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
a.setMainWidget( &hello );
hello.show();
return a.exec();
}
qmake后namke提示:
F:Studyt2>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
link /NOLOGO /SUBSYSTEM:windows /OUT:t2.exe @C:DOCUME~1BrillyLOCALS~1
Tempnma03640.
LINK : warning LNK4001: no object files specified; libraries used
LINK : warning LNK4068: /MACHINE not specified; defaulting to IX86
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
t2.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.
#include
#include
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
a.setMainWidget( &hello );
hello.show();
return a.exec();
}
qmake后namke提示:
F:Studyt2>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
link /NOLOGO /SUBSYSTEM:windows /OUT:t2.exe @C:DOCUME~1BrillyLOCALS~1
Tempnma03640.
LINK : warning LNK4001: no object files specified; libraries used
LINK : warning LNK4068: /MACHINE not specified; defaulting to IX86
LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
t2.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.
|
是不是要把/SUBSYSTEM:windows
改成/SUBSYSTEM:console
改成/SUBSYSTEM:console
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。