| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1786 人关注过本帖
标题:LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
只看楼主 加入收藏
heyyroup
Rank: 1
等 级:新手上路
帖 子:77
专家分:0
注 册:2006-6-14
收藏
 问题点数:0 回复次数:1 
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
我按照书上敲的程序,单个文件编译没问题,但是生成可执行文件时就出问题了。我刚学这个,大家帮帮忙,看看怎么解决这个问题
//coordin.h
#ifndef COORDIN_H_
#define COORDIN_H_
struct polar
{
double distance;
double angle;
};
struct rect
{
double x;
double y;
};
polar rect_to_polar(rect xypos);
void show_polar(polar dapos);
#endif
//file1.cpp
#include <iostream>
#include "coordin.h"
using namespace std;
int main()
{
rect rplace;
polar pplace;
cout<<"Enter the x and y values: ";
while(cin>>rplace.x>>rplace.y)
{
pplace=rect_to_polar(rplace);
show_polar(pplace);
cout<<"Next two numbers (q to quit): ";
}
cout<<"Bye!\n";
return 0;
}
//file2.cpp
#include <iostream>
#include <cmath>
#include "coordin.h"
polar rect_to_polar(rect xypos)
{
using namespace std;
polar answer;
answer.distance=sqrt(xypos.x*xypos.x+xypos.y*xypos.y);
answer.angle=atan2(xypos.y,xypos.x);
return answer;
}
void show_polar(polar dapos)
{
using namespace std;
const double Rad_to_deg=57.29577951;
cout<<"distance = "<<dapos.distance;
cout<<", angle = "<<dapos.angle*Rad_to_deg;
cout<<" degrees\n";
}
我在编译file2的时候出现以下错误
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
这是什么意思。应该如何解决呢???
搜索更多相关主题的帖子: symbol main lib error LIBCD 
2007-08-14 18:47
狂人老大
Rank: 1
来 自:杭州
等 级:新手上路
威 望:1
帖 子:394
专家分:0
注 册:2007-6-21
收藏
得分:0 

ACMer的QQ群:33741351
单片机QQ群:55130117
2007-08-14 23:31
快速回复:LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _ ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016905 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved