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...
Re: LINK error: LNK2001: unresolved external symbol
try add #include<windows.h> in your source file
check whether or not linked all needed dll
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....
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
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...
Re: LINK error: LNK2001: unresolved external symbol
Quote:
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.
Re: LINK error: LNK2001: unresolved external symbol
so plz can u tell how to write latest technique .....
Re: LINK error: LNK2001: unresolved external symbol
any one can help to resolve this prob.....
Re: LINK error: LNK2001: unresolved external symbol
Quote:
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?
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...
Re: LINK error: LNK2001: unresolved external symbol
Quote:
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.
Re: LINK error: LNK2001: unresolved external symbol
Quote:
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