A basic compiler error

Started by
5 comments, last by burgess_1984 18 years, 8 months ago
Hey there Im having alot of trouble trying to compile a programme. I have followed the authors directions for compling and included all the files and directories and im getting this recuring error with string.h sdk\include\string.h(143) : error C2059: syntax error : '*' c:\dxsdk\include\string.h(145) : error C2143: syntax error : missing ';' before '*' c:\dxsdk\include\string.h(145) : error C2501: 'wchar_t' : missing storage-class or type specifiers c:\dxsdk\include\string.h(145) : error C2086: 'wchar_t' : redefinition c:\dxsdk\include\string.h(145) : error C2061: syntax error : identifier 'wchar_t' c:\dxsdk\include\string.h(145) : error C2501: '_wcsnset' : missing storage-class or type specifiers c:\dxsdk\include\string.h(146) : error C2143: syntax error : missing ';' before '*' c:\dxsdk\include\string.h(146) : error C2501: 'wchar_t' : missing storage-class or type specifiers c:\dxsdk\include\string.h(146) : error C2086: 'wchar_t' : redefinition c:\dxsdk\include\string.h(146) : error C2061: syntax error : identifier 'wchar_t' c:\dxsdk\include\string.h(146) : error C2501: '_wcsrev' : missing storage-class or type specifiers c:\dxsdk\include\string.h(147) : error C2143: syntax error : missing ';' before '*' c:\dxsdk\include\string.h(147) : error C2501: 'wchar_t' : missing storage-class or type specifiers c:\dxsdk\include\string.h(147) : error C2086: 'wchar_t' : redefinition c:\dxsdk\include\string.h(147) : error C2061: syntax error : identifier 'wchar_t' c:\dxsdk\include\string.h(147) : error C2501: '_wcsset' : missing storage-class or type specifiers c:\dxsdk\include\string.h(148) : error C2143: syntax error : missing ';' before '*' c:\dxsdk\include\string.h(148) : error C2501: 'wchar_t' : missing storage-class or type specifiers c:\dxsdk\include\string.h(148) : error C2086: 'wchar_t' : redefinition c:\dxsdk\include\string.h(148) : error C2061: syntax error : identifier 'wchar_t' c:\dxsdk\include\string.h(148) : error C2501: '_wcsupr' : missing storage-class or type specifiers Im pretty sure this is only a small problem, you guys got any ideas??? thank you
Advertisement
Can't be 100% sure without seeing the first errors (seems you've posted only the last ones), but it's almost certainly that you forgot to include windows.h before your including any DirectX headers.
Kippesoep
OK here are "all" the errors........windows.h is included as well as dx files

Compiling...
blackbox.cpp
c:\dxsdk\include\stddef.h(200) : error C2371: 'size_t' : redefinition; different basic types
C:\DOCUME~1\Chris\LOCALS~1\Temp\a03540if(72) : see declaration of 'size_t'
c:\dxsdk\include\string.h(110) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(110) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(110) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(110) : error C2501: 'wcscat' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(111) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(111) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(111) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(111) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(111) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(111) : error C2501: 'wcschr' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(112) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(112) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(113) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(113) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(114) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(114) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(114) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(114) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(114) : error C2501: 'wcscpy' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(115) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(115) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(117) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(117) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(118) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(118) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(118) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(118) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(118) : error C2501: 'wcsncat' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(119) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(119) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(120) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(120) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(120) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(120) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(121) : error C2501: 'wcsncpy' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(122) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(122) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(122) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(122) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(122) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(122) : error C2501: 'wcspbrk' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(123) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(123) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(123) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(123) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(123) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(123) : error C2501: 'wcsrchr' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(124) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(124) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(125) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(125) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(125) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(125) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(125) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(125) : error C2501: 'wcsstr' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(126) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(126) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(126) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(126) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(126) : error C2501: 'wcstok' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(127) : error C2065: 'wsTransformed' : undeclared identifier
c:\dxsdk\include\string.h(127) : error C2059: syntax error : 'const'
c:\dxsdk\include\string.h(139) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(139) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(139) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(139) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(139) : error C2501: '_wcsdup' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(140) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(140) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(141) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(141) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(142) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(142) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(142) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(142) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(142) : error C2501: '_wcslwr' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(143) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(143) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(145) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(145) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(145) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(145) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(145) : error C2501: '_wcsnset' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(146) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(146) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(146) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(146) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(146) : error C2501: '_wcsrev' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(147) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(147) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(147) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(147) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(147) : error C2501: '_wcsset' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(148) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(148) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(148) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(148) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(148) : error C2501: '_wcsupr' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(182) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(182) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(182) : fatal error C1003: error count exceeds 100; stopping compilation
freakout.cpp
c:\dxsdk\include\stddef.h(200) : error C2371: 'size_t' : redefinition; different basic types
C:\DOCUME~1\Chris\LOCALS~1\Temp\a03540if(72) : see declaration of 'size_t'
c:\dxsdk\include\string.h(110) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(110) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(110) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(110) : error C2501: 'wcscat' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(111) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(111) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(111) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(111) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(111) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(111) : error C2501: 'wcschr' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(112) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(112) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(113) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(113) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(114) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(114) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(114) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(114) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(114) : error C2501: 'wcscpy' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(115) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(115) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(117) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(117) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(118) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(118) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(118) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(118) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(118) : error C2501: 'wcsncat' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(119) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(119) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(120) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(120) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(120) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(120) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(121) : error C2501: 'wcsncpy' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(122) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(122) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(122) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(122) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(122) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(122) : error C2501: 'wcspbrk' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(123) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(123) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(123) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(123) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(123) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(123) : error C2501: 'wcsrchr' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(124) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(124) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(125) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(125) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(125) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(125) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(125) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(125) : error C2501: 'wcsstr' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(126) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(126) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(126) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(126) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(126) : error C2501: 'wcstok' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(127) : error C2065: 'wsTransformed' : undeclared identifier
c:\dxsdk\include\string.h(127) : error C2059: syntax error : 'const'
c:\dxsdk\include\string.h(139) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(139) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(139) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(139) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(139) : error C2501: '_wcsdup' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(140) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(140) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(141) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(141) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(142) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(142) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(142) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(142) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(142) : error C2501: '_wcslwr' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(143) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(143) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(145) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(145) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(145) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(145) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(145) : error C2501: '_wcsnset' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(146) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(146) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(146) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(146) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(146) : error C2501: '_wcsrev' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(147) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(147) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(147) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(147) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(147) : error C2501: '_wcsset' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(148) : error C2143: syntax error : missing ';' before '*'
c:\dxsdk\include\string.h(148) : error C2501: 'wchar_t' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(148) : error C2086: 'wchar_t' : redefinition
c:\dxsdk\include\string.h(148) : error C2061: syntax error : identifier 'wchar_t'
c:\dxsdk\include\string.h(148) : error C2501: '_wcsupr' : missing storage-class or type specifiers
c:\dxsdk\include\string.h(182) : error C2143: syntax error : missing ',' before '*'
c:\dxsdk\include\string.h(182) : error C2059: syntax error : '*'
c:\dxsdk\include\string.h(182) : fatal error C1003: error count exceeds 100; stopping compilation
Error executing cl.exe.

freakout.exe - 204 error(s), 0 warning(s)
I'm not sure, but it sounds like your compiler doesn't regonize wchar_t.
Im using ms vc++.......
Quote:Original post by burgess_1984
OK here are "all" the errors........windows.h is included as well as dx files


Make sure you include it first. Generally, you need only this:
#include <windows.h>#include <d3d9.h>//optionally#include <d3dx9.h>


I'm a bit surprised at the errors you're getting stddef.h and string.h are not part of DirectX, so why are they in the DX SDK's include directory? These headers are part of the C standard library (although you really should include cstring instead of string.h and cstddef instead of stddef.h).
Kippesoep
Thanks a lot people, I fixed the compile errors by removing the standard files from the sdk dir and then found about linking errors but fixed these on my own.
I forgot to include ddraw.lib also.

Now i can start to look at the code and see how the changes i make change the programme. Im glad im moving on from visual basic even though im still struggling.



chris

This topic is closed to new replies.

Advertisement