Compiler not recognising DirectX objects/function calls!!!

Started by
9 comments, last by flukus 21 years, 4 months ago
I''ve included the header and library files and I can''t think of what I''m missing, anyone got any ideas?
Advertisement
could you post more details? what are the exact errors?

on a hunch: include dxguid.lib It''s caused problems for me somewhat like what I think you mean.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

At a line like this:

LPDIRECTDRAWSURFACE7 images[MAX_BOB_FRAMES]; // the bitmap images DD surface

I get the errors :

error C2146: syntax error : missing '';'' before identifier ''images''
error C2501: ''LPDIRECTDRAWSURFACE7'' : missing storage-class or type specifiers
error C2501: ''images'' : missing storage-class or type specifiers

And I''m using VC++.
Anyone????? I''ve been stucj on this for days.
And you have included directdraw.h and imported ddraw.lib and dxguid.lib? Depending on your COM initialization you may or may not need dxguid, but since you are having difficulties you may want to try it if you haven't. If you have done that, those errors would not be occuring...under normal conditions ;-)

Brian

EDIT: Make sure that directdraw.h is included BEFORE the file you are creating the variable from:

#include <directdraw.h>
#include "MyHeader.h"

in fact, try making directdraw.h first (or second to windows.h)

[edited by - bjmumblingmiles on December 8, 2002 9:04:17 PM]
Brian J
yeah...did that fix it? it should have...
Programmers of the world, UNTIE!
I''ve included ddraw.h and ddraw.lib and dxguid.lib are both in the link list!
what SDK version do you have? I Assume it''s 7 or above.

Just to be sure...see if that line works with just "LPDIRECTDRAW".

you may have your link library folders not set to the folder that the latest versions of ddraw.h/dxguid.h/ddraw.lib are in.
are you sure of that?
Programmers of the world, UNTIE!
MS VC++ ships with an old version of the DirectX header/library files. You need to goto Tools | Options, then Directories, and add the path to your DX SDK includes and libraries to the appropriate sections. Also, make sure you use the UP arrows so they are listed on TOP.

- Andy Oxfeld
Actually, it does work with just LPDIRECTDRAW.

"you may have your link library folders not set to the folder that the latest versions of ddraw.h/dxguid.h/ ddraw.lib are in.
are you sure of that? "

The only DXsdk I''ve ever had on my computer is DX8.

This topic is closed to new replies.

Advertisement