Archived

This topic is now archived and is closed to further replies.

error question

This topic is 6361 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ive been using LaMothe''s "Tricks" book and been trying to use functions from header files he made that I include in my program. I often get error messages like these and I dont know what they mean or how to fix them Animal.obj : error LNK2001: unresolved external symbol "int __cdecl Load_Bitmap_File(struct BITMAP_FILE_TAG *,char *)" (? Load_Bitmap_File@@YAHPAUBITMAP_FILE_TAG@@PAD@Z) Animal.obj : error LNK2001: unresolved external symbol "int __cdecl DDraw_Fill_Surface(struct IDirectDrawSurface4 *,int)" (? DDraw_Fill_Surface@@YAHPAUIDirectDrawSurface4@@H@Z) Debug/Animal.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. Ive seen errors like this a lot, not just in this example and they have always confused me. What Ive been trying to do lately is load a bitmap from a file and put it on the screen using his functions, but I cant get it to work. I posted this here in case someone else has tried to put bitmaps on the screen with his book and could offer some help. Either way, any advice would be appreciated. Thanks

Share this post


Link to post
Share on other sites
Try adding all of directx's libraries into your project including Winmm.lib and DxGuid.lib (From VC++ libraries).
Also try include this headers into your program (If they are not already there) :

windows.h
windowsx.h
mmsystem.h
iostream.h
conio.h
stdlib.h
malloc.h
memory.h
string.h
stdarg.h
stdio.h
math.h
io.h
fcntl.h
ddraw.h
dsound.h
dinput.h


Edited by - Tornado on July 16, 2000 4:17:09 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
it sounds like you''re trying to link C and C++ modules together. Make sure you declare the C functions as extern "C" {}. Or you can rename the .c files to .cpp and compile them with the C++ compiler....

Share this post


Link to post
Share on other sites