Direct X Error messages with VC++

Started by
10 comments, last by Woody FX 22 years, 2 months ago
Trying to recompile some code that was written for DirectX 7 but i''ve got DirectX 8 SDK installed and i''m gettin some errors I put the ole #define DIRECTDRAW_VERSION 0x0700 before #include ddraw.h But i''m still getting these some errors These are the defines and includes from the file that the errors appear to be from //include guard #ifndef DDFUNCS_H #define DDFUNCS_H #include <windows.h> #define DIRECTDRAW_VERSION 0x0700 #include "ddraw.h" #include "GDICanvas.h" This is the code the the error messages seems to point to /////////////////////////////////////////////////////////////////////////////// //Direct Draw Initialization/Cleanup functions /////////////////////////////////////////////////////////////////////////////// //create direct draw interface LPDIRECTDRAW7 LPDD_Create(HWND hWnd,DWORD dwCoopLevel); And here are the actual error messages!!! Deleting intermediate files and output files for project ''Littlerunningman - Win32 Debug''. --------------------Configuration: Littlerunningman - Win32 Debug-------------------- Compiling... DDFuncs.cpp c:\windows\desktop\gamedev\sourceiso\source\chapter10\isohex10_2\ddfuncs.h(65) : error C2146: syntax error : missing '';'' before identifier ''LPDD_Create'' c:\windows\desktop\gamedev\sourceiso\source\chapter10\isohex10_2\ddfuncs.h(65) : error C2501: ''LPDIRECTDRAW7'' : missing storage-class or type specifiers c:\windows\desktop\gamedev\sourceiso\source\chapter10\isohex10_2\ddfuncs.h(65) : fatal error C1004: unexpected end of file found GDICanvas.cpp IsoHex10_2.cpp c:\windows\desktop\gamedev\sourceiso\source\chapter10\isohex10_2\ddfuncs.h(65) : error C2146: syntax error : missing '';'' before identifier ''LPDD_Create'' c:\windows\desktop\gamedev\sourceiso\source\chapter10\isohex10_2\ddfuncs.h(65) : error C2501: ''LPDIRECTDRAW7'' : missing storage-class or type specifiers c:\windows\desktop\gamedev\sourceiso\source\chapter10\isohex10_2\ddfuncs.h(65) : fatal error C1004: unexpected end of file found TileSet.cpp c:\windows\desktop\gamedev\sourceiso\source\chapter10\isohex10_2\ddfuncs.h(65) : error C2146: syntax error : missing '';'' before identifier ''LPDD_Create'' c:\windows\desktop\gamedev\sourceiso\source\chapter10\isohex10_2\ddfuncs.h(65) : error C2501: ''LPDIRECTDRAW7'' : missing storage-class or type specifiers c:\windows\desktop\gamedev\sourceiso\source\chapter10\isohex10_2\ddfuncs.h(65) : fatal error C1004: unexpected end of file found Error executing cl.exe. Littlerunningman.exe - 9 error(s), 0 warning(s) Thanks Brain
Advertisement
If you''d like a copy of the code i can send it to you!!

B_Doyle1@yahoo.com_NO_Spam or leave me your address!!

Thanking You
Have you checked that the path of the DX7 SDK is before the VC include path? (Options/Directories/Include Files). If not you should change the order for your libs, too.
By the way, the DirectX forum would have been a better place for this post.

Edited by - VolkerG on February 7, 2002 10:00:30 AM
Using DirectX SDK 8!! So i''m not sure what you mean by include the DD 7 stuff!!
Bump!
Are you including dxguid.lib? Not sure if your code NEEDS it, but its sometimes needed for certain directx calls.

- Kevin "BaShildy" King
Game Programmer: DigiPen
www.mpogd.com
- Kevin "BaShildy" KingGame Programmer: DigiPenwww.mpogd.com
quote:Original post by Woody FX
Using DirectX SDK 8!! So i''m not sure what you mean by include the DD 7 stuff!!

VolkerG meant that the DX8 include directory must occur before the preconfigured MSVC include directories in the list of directories to search for include files. The reason for this is that MSVC comes with an old version of DX (3 or 5 I think), and the compiler will use whatever ddraw.h file it finds first.
Yeah i''ve done all of that.... Using Tanstaafl''s Isometric Book so i''ve done everything he said... but his code was writen for SDK 7.. and i cannot figure out how to get it workin with SDK 8 and no modifications.... except for putting in the #define direct_draw version 7


#ifndef DDFUNCS_H
#define DDFUNCS_H

Do i need to put something brfore the pieces of code(above) to tell it to reference DX7
Yeah i''ve done all of that.... Using Tanstaafl''s Isometric Book so i''ve done everything he said... but his code was writen for SDK 7.. and i cannot figure out how to get it workin with SDK 8 and no modifications.... except for putting in the #define direct_draw version 7


#ifndef DDFUNCS_H
#define DDFUNCS_H

Do i need to put something brfore the pieces of code(above) to tell it to reference DX7

That #define should do the trick for you.

Shouldn''t your #include "ddraw.h" be #include <ddraw.h> ?
And double check your syntax as well. A missing ; for example.

Guy

This topic is closed to new replies.

Advertisement