VC编译出现的问题

来源:百度知道 编辑:UC知道 时间:2024/05/22 20:45:29
编一简单的程序如下:
#include <iostream.h>
struct Point
{
int x;
int y;
};

void main()
{
Point pt;
pt.x=5;
pt.y=5;
cout<<pt.x<<endl<<pt.y<<endl;
}

可是编译时出现了错误:

Linking...
LINK : fatal error LNK1104: cannot open file "libcid.lib"
Error executing link.exe.

哪们高手能给解决一下,我看了下工具--目录下的路径应该是没有问题的...
改成了cout<<pt.x<<endl;
cout<<pt.y<<endl;
后,编译显视如下 :

microsoft visual studio\vc98\include\iostream.h(52) : fatal error C1083: Cannot open include file: 'ios.h': No such file or directory
Error executing cl.exe.

是不是我用的版本的问题呢。。。用的是精简版的!!!

3楼的那样改完后也是差不多的错误的:
fatal error C1083: Cannot open include file: 'iostream': No such file or directory
Error executing cl.exe.

#include <iostream.h>

改为 #include <iostream>

===========================
以下代码在 VC 2003 中没有问题,如果你那里还有问题,那就可能是你的工具没装好了,有问题联系我
#include <iostream>
using namespace std; //注意这个要加的
struct Point
{
int x;
int y;
};

void main()
{
Point pt;
pt.x=5;
pt.y=5;
cout<<pt.x<<endl<<pt.y<<endl;
}

cout<<pt.x<<endl;
cout<<pt.y<<endl;
你的代码没有问题.只是main()函数是一个返回int的函数.不要写在void的.因为你的程序要向操作系统返回一个值!
如果用这两句代码还不好用的话,一定是你的VC有问题.去再下载一个吧!

cout<<pt.x<<endl<<pt.y<<endl; 不行.分开写
cout<<pt.x<<endl;
cout<<pt.y<<endl;

应该是你的工程里面的,包含文件的目录没有设置正确