3 Replies - 245 Views - Last Post: 03 August 2014 - 07:35 PM Rate Topic: -----

#1 cybr  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-March 14

fatal error LNK1120: 1 unresolved external

Posted 03 August 2014 - 07:17 PM

hy guys help me .....

when i compile the following code , compiler through error as ..."fatal error LNK1120: 1 unresolved external "
     #include<iostream>
#include<conio.h>
#include<string.h>
using namespace std;
void mix(char,int);
int mian()
{
	mix('=',50);

	cout<<"data types and rang"<<endl;
	cout<<"char   -128 to 127 ";
	cout<<"short   -32,768, to 32.767 ";
	cout<<"int   -system dependent  ";
	cout<<"  double  -2,483,648 to 2,483,647 ";
	cout<<endl;
	mix('-',40);
	
	return 0;
}

void mix(char ch , int n )
{
	for (int j=0;j<n;j++)
		cout<<ch;
		cout<<endl;
}


This post has been edited by Skydiver: 03 August 2014 - 07:32 PM
Reason for edit:: Put code in code tags. Learn to do this yourself.


Is This A Good Question/Topic? 0
  • +

Replies To: fatal error LNK1120: 1 unresolved external

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3623
  • View blog
  • Posts: 11,291
  • Joined: 05-May 12

Re: fatal error LNK1120: 1 unresolved external

Posted 03 August 2014 - 07:33 PM

Post all the error and warning messages. They often contain important information. In the case above, you trimmed away what the unresolved external was.
Was This Post Helpful? 0
  • +
  • -

#3 tarmizi_adam2005  Icon User is offline

  • جوروترا

Reputation: 238
  • View blog
  • Posts: 865
  • Joined: 18-April 09

Re: fatal error LNK1120: 1 unresolved external

Posted 03 August 2014 - 07:35 PM

Hi,

Line 6:

int mian()


what ??
Was This Post Helpful? 1
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3623
  • View blog
  • Posts: 11,291
  • Joined: 05-May 12

Re: fatal error LNK1120: 1 unresolved external

Posted 03 August 2014 - 07:35 PM

If I had to guess, though, I'm guessing the linker was complaining about an unresolved external looking for "main". Look closely at the spelling on your line 6.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1