Unresolved External Error

Page 1 of 1

9 Replies - 1553 Views - Last Post: 18 May 2010 - 04:39 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=174041&amp;s=1bb0940e9e297f4dc0fa827e7bcca481&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#1 babyhulk71

Reputation: 0
• Posts: 6
• Joined: 17-May 10

Unresolved External Error

Posted 17 May 2010 - 02:06 PM

Can someone dummy down an explanation of why I'm getting this error in my compiler. Error 2 error LNK1120: 1 unresolved externals c:\users\tony\documents\visual studio 2010\Projects\week3ilab2\Debug\week3ilab2.exe 1
This is the coding I'm running and using visual studio 2010.
```#include <iostream>
using namespace std;
void mult(int x,int y)
{
int i,j;
cout<< "X";
for (i=x;i<=y;i++)
cout <<" "<<i;
cout << endl;
for (i=x;i<=y;i++){
cout<<i<<" ";
for (j=x;j<=y;j++)
cout<<i*j<<" ";
cout << "\n";
}
}
int main()
{
int x,y;
cin>>x>>y;
if (x<y)
mult(x,y);
else
mult (y,x);
return 0;
}
```

Admin Edit: Please use code tags when posting your code. Code tags are used like so =>

Thanks,
PsychoCoder

Is This A Good Question/Topic? 0

Replies To: Unresolved External Error

#2 Nakor

• Professional Lurker

Reputation: 448
• Posts: 1,504
• Joined: 28-April 09

Re: Unresolved External Error

Posted 17 May 2010 - 02:24 PM

Not sure why you would be getting that, I'm having no problem running the code on my machine

#3 babyhulk71

Reputation: 0
• Posts: 6
• Joined: 17-May 10

Re: Unresolved External Error

Posted 17 May 2010 - 02:50 PM

Nakor, on 17 May 2010 - 01:24 PM, said:

Not sure why you would be getting that, I'm having no problem running the code on my machine

Thanks. Do you think its my compiler, should I use a later version?

• Saucy!

Reputation: 6219
• Posts: 23,965
• Joined: 23-August 08

Re: Unresolved External Error

Posted 17 May 2010 - 03:26 PM

What is the full error message, i.e., what is it saying is an unresolved external?

I mean, with Visual Studio 2010, you're more up-to-date than most. This is almost definitely NOT a compiler issue.

#5 apw5020

Reputation: 78
• Posts: 666
• Joined: 26-March 09

Re: Unresolved External Error

Posted 17 May 2010 - 08:33 PM

I get no errors when compiling on Visual Studio 2010. Are you sure you created the right type of project? i.e. Win32 Console Application

#6 babyhulk71

Reputation: 0
• Posts: 6
• Joined: 17-May 10

Re: Unresolved External Error

Posted 18 May 2010 - 07:09 AM

apw5020, on 17 May 2010 - 07:33 PM, said:

I get no errors when compiling on Visual Studio 2010. Are you sure you created the right type of project? i.e. Win32 Console Application

It must be something I'm doing wrong, Thanks guys.

#7 Jubb

Reputation: 6
• Posts: 88
• Joined: 06-May 09

Re: Unresolved External Error

Posted 18 May 2010 - 10:54 AM

I haven't used VS2010 yet but it might be that you removed "#include "stdafx.h"" and your project properties specify using that as a precompiled header. That's the default setting in VS2008, and I know many people have made that mistake before.

#8 KYA

• yay verily

Reputation: 3155
• Posts: 19,200
• Joined: 14-September 07

Re: Unresolved External Error

Posted 18 May 2010 - 11:03 AM

babyhulk71, on 18 May 2010 - 07:09 AM, said:

apw5020, on 17 May 2010 - 07:33 PM, said:

I get no errors when compiling on Visual Studio 2010. Are you sure you created the right type of project? i.e. Win32 Console Application

It must be something I'm doing wrong, Thanks guys.

We could tell you exactly what it is if you'd post the exact error as requested.

#9 babyhulk71

Reputation: 0
• Posts: 6
• Joined: 17-May 10

Re: Unresolved External Error

Posted 18 May 2010 - 04:37 PM

KYA, on 18 May 2010 - 10:03 AM, said:

babyhulk71, on 18 May 2010 - 07:09 AM, said:

apw5020, on 17 May 2010 - 07:33 PM, said:

I get no errors when compiling on Visual Studio 2010. Are you sure you created the right type of project? i.e. Win32 Console Application

It must be something I'm doing wrong, Thanks guys.

We could tell you exactly what it is if you'd post the exact error as requested.

I get these two errors.

1) Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup C:\Users\Tony\documents\visual studio 2010\Projects\week3ilab3\week3ilab3\MSVCRTD.lib(crtexew.obj)

2)Error 2 error LNK1120: 1 unresolved externals C:\Users\Tony\documents\visual studio 2010\Projects\week3ilab3\Debug\week3ilab3.exe

#10 Oler1s

• D.I.C Lover

Reputation: 1396
• Posts: 3,884
• Joined: 04-June 09

Re: Unresolved External Error

Posted 18 May 2010 - 04:39 PM

That error is precisely because you specified your project was a Win32 GUI project, not a console project. This is what apw5020 guessed at earlier.

In the future, remember to copy-paste errors completely, so no guessing is required.