Jump to content
  • Advertisement

Archived

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

Help

Major frustrating errors, why?

This topic is 6928 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

I''m getting these errors when trying to compile the second direct draw example included in the SDK. It''s the one where ddutil.cpp and ddutil.h are involved. The thing is, I have one file #include -ing ddutil.h, the one that the program body is in. Then, when I try to compile ddutil.cpp, which is also #include -ing ddutil.h, I get 87 errors. Some of them are in the header file and some are in the cpp file. I have a feeling this is going to really annoy me if I don''t get past such an awkward problem. Thanks a lot.--------------------Configuration: ddex2 - Win32 Debug-------------------- Compiling... ddutil.cpp c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(14) : error C2143: syntax error : missing '';'' before ''*'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(14) : error C2061: syntax error : identifier ''IDirectDraw7'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(14) : error C2501: ''DDLoadPalette'' : missing storage-class or type specifiers c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(15) : error C2143: syntax error : missing '';'' before ''*'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(15) : error C2061: syntax error : identifier ''IDirectDraw7'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(15) : error C2501: ''DDLoadBitmap'' : missing storage-class or type specifiers c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(16) : error C2065: ''pdds'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(16) : error C2275: ''LPCSTR'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\winnt.h(167) : see declaration of ''LPCSTR'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(16) : error C2146: syntax error : missing '')'' before identifier ''szBitmap'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(16) : error C2078: too many initializers c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(16) : error C2275: ''LPCSTR'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\winnt.h(167) : see declaration of ''LPCSTR'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(16) : error C2059: syntax error : '')'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(17) : error C2275: ''HBITMAP'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(232) : see declaration of ''HBITMAP'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(17) : error C2146: syntax error : missing '')'' before identifier ''hbm'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(17) : error C2078: too many initializers c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(17) : error C2275: ''HBITMAP'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(232) : see declaration of ''HBITMAP'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(17) : error C2059: syntax error : '')'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(18) : error C2275: ''COLORREF'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(281) : see declaration of ''COLORREF'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(18) : error C2146: syntax error : missing '')'' before identifier ''rgb'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(18) : error C2078: too many initializers c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(18) : error C2275: ''COLORREF'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(281) : see declaration of ''COLORREF'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(18) : error C2059: syntax error : '')'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(19) : error C2275: ''COLORREF'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(281) : see declaration of ''COLORREF'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(19) : error C2146: syntax error : missing '')'' before identifier ''rgb'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(19) : error C2078: too many initializers c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(19) : error C2275: ''COLORREF'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(281) : see declaration of ''COLORREF'' c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(19) : error C2059: syntax error : '')'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(28) : error C2143: syntax error : missing '';'' before ''*'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(29) : error C2061: syntax error : identifier ''IDirectDraw7'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(30) : error C2501: ''DDLoadBitmap'' : missing storage-class or type specifiers c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(33) : error C2065: ''DDSURFACEDESC2'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(33) : error C2146: syntax error : missing '';'' before identifier ''ddsd'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(33) : error C2065: ''ddsd'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(34) : warning C4552: ''*'' : operator has no effect; expected operator with side-effect c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(39) : error C2065: ''szBitmap'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(39) : error C2065: ''dx'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(40) : error C2065: ''dy'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(54) : error C2228: left of ''.dwSize'' must have class/struct/union type c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(55) : error C2228: left of ''.dwFlags'' must have class/struct/union type c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(55) : error C2065: ''DDSD_CAPS'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(55) : error C2065: ''DDSD_HEIGHT'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(55) : error C2065: ''DDSD_WIDTH'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(56) : error C2228: left of ''.ddsCaps'' must have class/struct/union type c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(56) : error C2228: left of ''.dwCaps'' must have class/struct/union type c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(56) : error C2065: ''DDSCAPS_OFFSCREENPLAIN'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(57) : error C2228: left of ''.dwWidth'' must have class/struct/union type c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(58) : error C2228: left of ''.dwHeight'' must have class/struct/union type c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(59) : error C2065: ''pdd'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(59) : error C2227: left of ''->CreateSurface'' must point to class/struct/union c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(59) : error C2065: ''DD_OK'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(74) : error C2275: ''LPCSTR'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\winnt.h(167) : see declaration of ''LPCSTR'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(74) : error C2146: syntax error : missing '')'' before identifier ''szBitmap'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(74) : error C2374: ''DDReLoadBitmap'' : redefinition; multiple initialization c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(16) : see declaration of ''DDReLoadBitmap'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(74) : error C2078: too many initializers c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(74) : error C2275: ''LPCSTR'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\winnt.h(167) : see declaration of ''LPCSTR'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(74) : error C2059: syntax error : '')'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(75) : error C2143: syntax error : missing '';'' before ''{'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(75) : error C2447: missing function header (old-style formal list?) c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(109) : error C2275: ''HBITMAP'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(232) : see declaration of ''HBITMAP'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(109) : error C2146: syntax error : missing '')'' before identifier ''hbm'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(109) : error C2374: ''DDCopyBitmap'' : redefinition; multiple initialization c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(17) : see declaration of ''DDCopyBitmap'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(109) : error C2078: too many initializers c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(109) : error C2275: ''HBITMAP'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(232) : see declaration of ''HBITMAP'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(110) : error C2059: syntax error : '')'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(111) : error C2143: syntax error : missing '';'' before ''{'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(111) : error C2447: missing function header (old-style formal list?) c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(163) : error C2143: syntax error : missing '';'' before ''*'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(164) : error C2061: syntax error : identifier ''IDirectDraw7'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(165) : error C2501: ''DDLoadPalette'' : missing storage-class or type specifiers c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(166) : error C2065: ''ddpal'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(166) : warning C4552: ''*'' : operator has no effect; expected operator with side-effect c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(243) : error C2227: left of ''->CreatePalette'' must point to class/struct/union c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(243) : error C2065: ''DDPCAPS_8BIT'' : undeclared identifier c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(257) : error C2275: ''COLORREF'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(281) : see declaration of ''COLORREF'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(257) : error C2146: syntax error : missing '')'' before identifier ''rgb'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(257) : error C2374: ''DDColorMatch'' : redefinition; multiple initialization c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(18) : see declaration of ''DDColorMatch'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(257) : error C2078: too many initializers c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(257) : error C2275: ''COLORREF'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(281) : see declaration of ''COLORREF'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(257) : error C2059: syntax error : '')'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(258) : error C2143: syntax error : missing '';'' before ''{'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(258) : error C2447: missing function header (old-style formal list?) c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(308) : error C2275: ''COLORREF'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(281) : see declaration of ''COLORREF'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(308) : error C2146: syntax error : missing '')'' before identifier ''rgb'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(308) : error C2374: ''DDSetColorKey'' : redefinition; multiple initialization c:\mssdk\samples\multimedia\ddraw\include\ddutil.h(19) : see declaration of ''DDSetColorKey'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(308) : error C2078: too many initializers c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(308) : error C2275: ''COLORREF'' : illegal use of this type as an expression c:\program files\microsoft visual studio\vc98\include\windef.h(281) : see declaration of ''COLORREF'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(308) : error C2059: syntax error : '')'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(309) : error C2143: syntax error : missing '';'' before ''{'' c:\mssdk\samples\multimedia\ddraw\src\ddex2\ddutil.cpp(309) : error C2447: missing function header (old-style formal list?) ddex2.cpp Error executing cl.exe. ddex2.exe - 87 error(s), 2 warning(s)

Share this post


Link to post
Share on other sites
Advertisement
Ok Help, first of all, I don''t think we needed ALL of the errors to be posted, you will find that the first error in the code is ALWAYS indicated within the first 3-5 error messages. In this case i believe you simply do not have the include paths for your compiler set correctly. Assuming you are using MSVC 6.0 you need to set up the include and library paths for the direct X sdk. AND you must move these paths to the TOP of the list of paths, BEFORE the general MSVC directories. If that does not work, post back to this thread again.

Share this post


Link to post
Share on other sites
Unfortunately that has not helped. Could someone tell me what is wrong with the ddutil.h file? It just keeps spouting hundreds of errors and I have no idea what is wrong with it.

Share this post


Link to post
Share on other sites
Nothing is wrong with DDUTIL.H, lots of people use it ok. The path to the SDK files seems like the most likely problem. But first, ensure that whatever files include ddutil.h have ddraw.h included first. That may make a difference if ddutil.h doesn't include that stuff itself.

If you open up a new file, type in #include <ddraw.h> , then right click on that and choose 'open document', is it opening your DirectDraw 7 header or a different one? Look down until you see a line similar to:
#define DIRECTDRAW_VERSION 0x0700
(DirectDraw 7) That is the way to tell.

Edited by - Kylotan on 5/7/00 5:43:55 AM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!