参考博客:c++控制台程序怎么隐藏-优快云博客 #pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" ) 加上以上的宏就可以了