VS2010 Error LNK2019&FATAL ERROR LNK1120
代码:#include<iostream>usingnamespacestd;#include<string>usingstd::string;#include"Reco...
代码:
#include <iostream>using namespace std;#include <string> using std::string;#include "Record.h"
int main() { int choice;Record list[100];
cout<<"***********MAIN MENU*************"<<endl; cout<<"1. Initialize the address book...."<<endl; cout<<"Please enter your choices (1,2,3,4 or 5 to quit)"<<endl; cin>>choice;
if(choice==1) { list[0].setName("Lawrence Cheung"); list[0].setEAdd("enccl@eie.polyu.edu.hk"); list[0].setPhoNo(27666131); list[1].setName("Helen Wong"); list[1].setEAdd("helenwong@yahoo.com.hk"); list[1].setPhoNo(94665888); list[2].setName("Simon Sui"); list[2].setEAdd("ss123@hamil.com"); list[2].setPhoNo(64441234); list[3].setName("Mary Ho"); list[3].setEAdd("ho.mary10@netvigator.com"); list[3].setPhoNo(21111112); for(int y=0;y<=3;y=y+1) {cout<<"Name is: "<<list[y].getName()<<"Email is: "<<list[y].getEAdd()<<"Telephone number is: "<<list[y].getPhoNo()<<endl;} cout<<endl; } 重覆cout<<"MAIN MENU....到cin>>choice;
return 0;}
显示问题:
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用1>C:\Users\Kelly\Documents\Visual Studio 2010\Projects\AddressBook\Debug\AddressBook.exe : fatal error LNK1120: 1 个无法解析的外部命令
问题出在哪? 展开
#include <iostream>using namespace std;#include <string> using std::string;#include "Record.h"
int main() { int choice;Record list[100];
cout<<"***********MAIN MENU*************"<<endl; cout<<"1. Initialize the address book...."<<endl; cout<<"Please enter your choices (1,2,3,4 or 5 to quit)"<<endl; cin>>choice;
if(choice==1) { list[0].setName("Lawrence Cheung"); list[0].setEAdd("enccl@eie.polyu.edu.hk"); list[0].setPhoNo(27666131); list[1].setName("Helen Wong"); list[1].setEAdd("helenwong@yahoo.com.hk"); list[1].setPhoNo(94665888); list[2].setName("Simon Sui"); list[2].setEAdd("ss123@hamil.com"); list[2].setPhoNo(64441234); list[3].setName("Mary Ho"); list[3].setEAdd("ho.mary10@netvigator.com"); list[3].setPhoNo(21111112); for(int y=0;y<=3;y=y+1) {cout<<"Name is: "<<list[y].getName()<<"Email is: "<<list[y].getEAdd()<<"Telephone number is: "<<list[y].getPhoNo()<<endl;} cout<<endl; } 重覆cout<<"MAIN MENU....到cin>>choice;
return 0;}
显示问题:
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用1>C:\Users\Kelly\Documents\Visual Studio 2010\Projects\AddressBook\Debug\AddressBook.exe : fatal error LNK1120: 1 个无法解析的外部命令
问题出在哪? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询