fatal error LNK1136: invalid or corrupt file

Started by
1 comment, last by DarkEldar77 22 years, 10 months ago
Hello, When I compile a program, I receive the following error: Linking... ddraw.h : fatal error LNK1136: invalid or corrupt file Error executing link.exe. I reinstalled the directx8 SDK but that didn’t help me. How would I fix this problem? Please don''t think that I am dumb because I am only 15 years old and I just started to program in directX. Thank You for your help
Visit My C++ Programming Site:http://darkeldar77.tripod.com/cpp.html
Advertisement
Hi,

I might be missing something, but you probably shouldn''t be linking with ddraw.h... Try ddraw.lib

Hope this helps,



-ns-
-ns-
Yeah, that''s the problem. You include header files in your code with the #include<> statement, and you include library files in the project link settings. There''s an alternate way to do it in code:

#pragma comment("lib", "ddraw.lib")

Also, if you''re using dx8, make sure you add a define before you do includes so it knows you''re using directdraw--I''m not positive, but I think you have to add this line:

#define DIRECTDRAW_VERSION 0x0700

if you''re using DirectDraw 7 functions. Hope that helps.
--


WNDCLASSEX Reality;
...
...
Reality.lpfnWndProc=ComputerGames;
...
...
RegisterClassEx(&Reality);


Unable to register Reality...what''s wrong?
---------
Dan Upton
Lead Designer
WolfHeart Software
WNDCLASSEX Reality;......Reality.lpfnWndProc=ComputerGames;......RegisterClassEx(&Reality);Unable to register Reality...what's wrong?---------Dan Uptonhttp://0to1.orghttp://www20.brinkster.com/draqza

This topic is closed to new replies.

Advertisement