|
-
May 2nd, 2010, 11:42 PM
#1
LINK error: LNK2001: unresolved external symbol
hi ,
i am using MSDN library functions in my c file. I want to create a GUI using some of the following functions like
CreateWindowEx
ShowWindow
AdjustWindowRect
LoadCursor
SetWindowPos
CreatePen
TextOut
LineTo
MoveToEx etc....
but whn i build the project i'm getting link error while creating .obj file for all of the functions which ever i'm using.
the errors are like:
error LNK2001: unresolved external symbol __imp__GetMessageA@16
win.obj : error LNK2001: unresolved external symbol __imp__SetTimer@16
win.obj : error LNK2001: unresolved external symbol __imp__UpdateWindow@4
win.obj : error LNK2001: unresolved external symbol __imp__ShowWindow@8
win.obj : error LNK2001: unresolved external symbol __imp__SetWindowPos@28
like this fr all of the functions which are used...
if anyone cm across these type of problems plz help...
Last edited by shri1609; May 2nd, 2010 at 11:45 PM.
-
May 3rd, 2010, 01:46 AM
#2
Re: LINK error: LNK2001: unresolved external symbol
try add #include<windows.h> in your source file
check whether or not linked all needed dll
-
May 3rd, 2010, 02:02 AM
#3
Re: LINK error: LNK2001: unresolved external symbol
hi.
ya i ve included these all
#include <windows.h>
#include <winbase.h>
#include <DDraw.h>
can u plz tell who to check all dll r linked or not....
-
May 3rd, 2010, 02:07 AM
#4
Re: LINK error: LNK2001: unresolved external symbol
Perhaps it has to do with some calling conventions mismatch since you are using this in a C file but the linker output seems to indicate some different calling convention leading to mangling of the API names. Maybe you can move this code to a c++ file and test if it works there
-
May 3rd, 2010, 02:11 AM
#5
Re: LINK error: LNK2001: unresolved external symbol
thnks fr tht sujection but i cant move tat part to c++.. its part of a huge application which has to run in c only... and one more thing i 'm using VC++ 6.0 fr this app...
Last edited by shri1609; May 3rd, 2010 at 03:59 AM.
-
May 3rd, 2010, 05:12 AM
#6
Re: LINK error: LNK2001: unresolved external symbol
 Originally Posted by shri1609
hi.
ya i ve included these all
#include <windows.h>
#include <winbase.h>
#include <DDraw.h>
can u plz tell who to check all dll r linked or not....
It's really hard to take you seriously when you write like a three year old.
-
May 3rd, 2010, 06:03 AM
#7
Re: LINK error: LNK2001: unresolved external symbol
so plz can u tell how to write latest technique .....
-
May 5th, 2010, 02:06 AM
#8
Re: LINK error: LNK2001: unresolved external symbol
any one can help to resolve this prob.....
-
May 5th, 2010, 02:39 AM
#9
Re: LINK error: LNK2001: unresolved external symbol
 Originally Posted by shri1609
so plz can u tell how to write latest technique .....
Did you learn in the school?
Does your keyboard work properly?
Victor Nijegorodov
-
May 5th, 2010, 04:21 AM
#10
Re: LINK error: LNK2001: unresolved external symbol
@GCDEF and @VictorN
if ur elite member of this forum thn it doesn't mean u can reply any way...
as i'm new to VC++ programming , i needed some clarification about the bug which im facing...
for that you cant reply like this... if u dont want to help thn leave it, who told to reply you plp...
sorry for comments...
-
May 5th, 2010, 05:17 AM
#11
Re: LINK error: LNK2001: unresolved external symbol
 Originally Posted by shri1609
@GCDEF and @VictorN
if ur elite member of this forum thn it doesn't mean u can reply any way...
as i'm new to VC++ programming , i needed some clarification about the bug which im facing...
for that you cant reply like this... if u dont want to help thn leave it, who told to reply you plp...
sorry for comments...
Or perhaps you could follow the posting guidelines of the forum. From the "Before you post" sticky.
Use real grammer. If you use things like "u r gr8", you are going to be seen as unprofessional. Worse, many of the people who speak English as a second language may not understand what you are saying -- and thus won't be able to respond.
Believe it or not, letting you know that writing like that won't get you far in the real world is helping - just not the help you're looking for right now I guess.
-
May 5th, 2010, 05:22 AM
#12
Re: LINK error: LNK2001: unresolved external symbol
 Originally Posted by shri1609
@GCDEF and @VictorN
if ur elite member of this forum thn it doesn't mean u can reply any way...
as i'm new to VC++ programming , i needed some clarification about the bug which im facing...
for that you cant reply like this... if u dont want to help thn leave it, who told to reply you plp...
sorry for comments...
Please write proper English. This forum is a professional programming forum, not Facebook, so writing proper English, or at least attempt to write proper English, is what is expected here. There are persons reading this thread whose first language is not English, and writing text message nonsense doesn't help those persons understand what's going on.
Secondly, those are linker errors. This means you are not linking the Windows libraries such as kernel32, user32, etc. It is very hard to get that error if you are using Visual Studio and just create a Win32 project, since a project knows to link in the correct Windows libraries.
So how did you set up your application? Are you using Visual Studio, and if so, what project did you select?
Regards,
Paul McKenzie
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|