This is a discussion on header file bringing errors? within the Windows Programming forums, part of the Platform Specific Boards category; I'm trying to use winprog.org's windows tutorial (it worked before!) and i copy + pasted the code. But these are ...

1. ## header file bringing errors?

I'm trying to use winprog.org's windows tutorial (it worked before!) and i copy + pasted the code. But these are the errors i get

Code:
```--------------------Configuration: net send v2 - Win32 Debug--------------------
Compiling...
main.cpp
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(584) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(584) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(584) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(594) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(594) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(594) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(640) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(640) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(640) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(649) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(649) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(649) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(928) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(928) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(928) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(939) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(939) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(939) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(994) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(994) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(994) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1003) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1003) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1003) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1271) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1271) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1271) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1280) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1280) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1280) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1395) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1395) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1395) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1403) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1403) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1403) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1469) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1469) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1469) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1491) : error C2146: syntax error : missing ';' before identifier 'vDriverVersion'
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1491) : error C2501: 'MMVERSION' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\mmsystem.h(1491) : error C2501: 'vDriverVersion' : missing storage-class or type specifiers
Error executing cl.exe.

main.obj - 42 error(s), 0 warning(s)```

And their all errors in the mmsystem.h header file. NOw, whats up with this??? i think something has been edited. Anyone have a mmsystem.h header file that works with mvc++

2. I ran this in MSVC++ 6.0:

Code:
```#include "mmsystem.h"

int main()
{
return 0;
}```
and I got the same errors you did whether I included windows.h or not:
Code:
```Compiling...
test.cpp
c:\program files\c++microsoft visual studio\vc98\include\mmsystem.h(113) :
error C2146: syntax error : missing ';' before identifier 'MMVERSION'
c:\program files\c++microsoft visual studio\vc98\include\mmsystem.h(113) :
fatal error C1004: unexpected end of file found
Error executing cl.exe.

test.exe - 2 error(s), 0 warning(s)```

3. Sounds like it needs another include file before it

4. Originally posted by _Elixia_
Sounds like it needs another include file before it
Aren't include files supposed to include all the stuff they depend on ? After all, that include once belonged to the source code of a library. How did they compile the lib with an incomplete include file?

5. Most likely because all the other include files were specified in the C program, so when that header got included, everything was already defined.

Another example would be pre-compiled include files.

Having an include file attempting to include everything necessary for it to compile properly can be trickly - specially if there are cross references between the two. Lots of the windows include files are like this - sometimes a simple "#include <windows.h>" cures them, othertimes it does not.