header file bringing errors?

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. #1
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269

    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++
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    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. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    245
    Sounds like it needs another include file before it

  4. #4
    *******argv[] - hu? darksaidin's Avatar
    Join Date
    Jul 2003
    Posts
    314
    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. #5
    Registered User
    Join Date
    Jun 2003
    Posts
    245
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 04:53 AM
  2. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 01:36 PM
  3. Need help understanding Header Files
    By Kaidao in forum C++ Programming
    Replies: 11
    Last Post: 03-25-2008, 11:02 AM
  4. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 04:39 AM
  5. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21