首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

第一次使用vs2010.请各位帮忙看看异常的意思是什么

2012-04-17 
第一次使用vs2010.请各位帮忙看看错误的意思是什么啊错误5error LNK2019: 无法解析的外部符号 _WinMain@16

第一次使用vs2010.请各位帮忙看看错误的意思是什么啊
错误5error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用C:\Users\xushuai\Documents\Visual Studio 2010\Projects\pro12.3\pro12.3\MSVCRTD.lib(crtexew.obj)pro12-3

错误6error LNK1120: 1 个无法解析的外部命令C:\Users\xushuai\Documents\Visual Studio 2010\Projects\pro12.3\Debug\pro12-3.exepro12-3




#include <stdio.h>
#include "pro12-3a.h"
int main(void)
  {
int mode;
int prev_mode=METRIC;
double distance,fuel;

printf("Enter 0 for metric modem,1 for US mode:");
scanf("%d",&mode);
while(mode>=0)
{
check_mode(&mode);
if(mode==METRIC)
mode=prev_mode;
get_info(mode,&distance,&fuel);
show_info(mode,distance,fuel);
printf("Enter 0 for meteric,1 for US mode");
printf("(-1 to quit.)");
scanf("%d",&mode);
}
printf("Done\n");
return 0;
  }

#include "pro12-3a.h"
#define METRIC 0
#define US 1
#define USE_RECENT 2

void check_mode(int *pm);
void get_info(int mode ,double * pd,double * pf);
void show_info(int mode,double distance,double fuel);


#include <stdio.h>
#include "pro12-3a.h"
void check_mode(int *pm)
  {
if(*pm!=METRIC && *pm!=US)
{
printf("Invalid mode specifide.Mode %d\n",*pm);
printf("Previous mode will be used.\n",*pm);
*pm=USE_RECENT;
}
  }

void get_info(int mode,double * pd,double *pf)
  {
if(mode==METRIC)
printf("Enter distance traveled in kilometers:");
else
printf("Enter distance traneled in miles:");
scanf("%lf",pd);
if (mode==METRIC)
printf("Enter fuel consumed in liters:");
else
printf("Enter fuel consumed in kilomiters:");
scanf("%lf",pf);
  }

void show_info(int mode,double distance,double fuel)
{
printf("Fuel consumption is");
if (mode==METRIC)
printf("%.2f liters per 100 km,\n",100*fuel/distance);
else
printf("%.1f miles per gallon.\n",distance/fuel);
  }



[解决办法]
lz 建立的什么 project? 检查下

是否是 win32 console application, 并且是empty project

热点排行