Visual Studio 2008 中 build 的问题

来源:百度知道 编辑:UC知道 时间:2024/05/01 19:32:11
我写了一段C++程序【注:开头用的是#include<iostream> using namespaces std;】,在Visual Studio 2008(以下简称VC)和Dev-C++中编译都通过了,但是在VC中点build不能通过。错误信息如下:

1>------ Build started: Project: P080130_01, Configuration: Debug Win32 ------
1>Linking...
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>D:\My Documents\Visual Studio 2008\Projects\P080130_01\Debug\P080130_01.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://d:\My Documents\Visual Studio 2008\Projects\P080130_01\P080130_01\Debug\BuildLog.htm"
1>P080130_01 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
注:Visual Studio 2008用的是新版C++,开头使用#include<iostream.h>的话编译都通不过

VC的设置:
项目属性里Linker->System->SubSystem设成Not Set

unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
这说明现在的设置是生成window工程

标准C++里的头文件就是叫<iostream>:)