Menu

empty ENUMS, gdiplus.h

2006-04-17
2012-09-26
  • Nobody/Anonymous

    when compiling a program with

    include <gdiplus.h>

    i get multiple errors:
    C:/Programme/Microsoft Platform SDK/Include/GdiplusEnums.h:534: error: use of enum EmfPlusRecordType' without previous declaration C:/Programme/Microsoft Platform SDK/Include/GdiplusEnums.h:548: error: invalid use of undefined typeenum Gdiplus::EmfPlusRecordType'
    C:/Programme/Microsoft Platform SDK/Include/GdiplusEnums.h:543: error: forward declaration of enum Gdiplus::EmfPlusRecordType' C:/Programme/Microsoft Platform SDK/Include/GdiplusEnums.h:548: error: enumerator value forWmfRecordTypeSetBkColor' not integer constant
    ...and so on

    someone else had this problem too: (german!)
    http://www.softgames.de/forum/frage116557.html

    there it says that the compiler doesnt like EMPTY ENUMS... whatever this means...

    i now tried Visual C++ and it returns similar errors :(

     
    • Nobody/Anonymous

      i have VC++ 6.0

      there is no version history on the microsoft site, but i guess it's obsolete.

      i'll update on monday.

      did the specification of c++ change over the years so that old compilers dont work with newer includes !?

      nicolas

       
      • Nobody/Anonymous

        Yes, do upgrade. MSVC 6.0 is a piece of non-standard garbage.

        No, the C++ standard has not changed--much--since 1998. That said, Microsoft uses plenty of non-standard features in some headers which may be a part of the problem.

        Soma

         
    • Nobody/Anonymous

      O_o

      It be magic--blast the leprecons, damn the torpedoes.

      Soma

       
    • Anonymous

      Anonymous - 2006-04-17

      Firstly the Microsoft Platform SDK is not intended to be used with Dev-C++, and even if the header is valid, Dev-C++ is not supplied with the necessary export file.

      I suggest that you stick with Visual C++ for this code, getting it working with Dev-C++ is not going to be easy, may not even be possible, and more than likely contrvenes some Microsoft license terms.

      I'm looking at GdiplusEnums.h now, and line 534 is simply a forward declaration for an enum defined later. I'm not sure that it needs forward declaration, since it is only used in a macro definition before the full definition, and the pre-processor would not care if it were defined or not.

      When shit happens in a 'known-good' header, which we can probably assume this is (at least in VC++), then it is usually caused by something in your own code that appears before the included header. So you need to take a look at the code that appears before #include <gdiplus.h>. If this is only other headers, you need to look at any that you wrote yourself. A quick test would be to move the #include <gdiplus.h> so that it is the forst line of the file, and see if the problem manifests itself differently.

      But most of all, stop trying to do this in Dev-C++!

      Clifford

       
      • Nobody/Anonymous

        You take all the fun out of this forum...

        Soma

         
        • Anonymous

          Anonymous - 2006-04-17

          That hurt! - OK, my turn to be mean tomorrow!

           
          • Nobody/Anonymous

            EEP!

            hides behind Wayne

            Soma

             
        • Wayne Keen

          Wayne Keen - 2006-04-17

          I thought that was what I did?

          Wayne

           
    • Nobody/Anonymous

      i'll try to get the fun back in !

      i didnt expect the answer "don't!"

      VC++ doesnt like me either. there's nothing preceding the include statement.
      i'm tired. good night.

      nicolas

       
      • Anonymous

        Anonymous - 2006-04-18

        The "don't", was because you can't not because we don't like you.

        Maybe we can help you with the VC++ problem nonetheless, but the same rules apply - we need example code, information on what version you are using, and the compile log.

        I guess being mean is just not in me today. I'll try harder.

        Clifford

         
        • Nobody/Anonymous

          Nah, it's 'cause you love me. Admit and be free. ^_^

          On another pointless note, you usually post much earlier in the evening. A busy day?

          Soma

           
    • Nobody/Anonymous

      --------------------Konfiguration: main - Win32 Debug--------------------
      Kompilierung läuft...
      main.cpp
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(32) : error C2065: 'ULONG_PTR' : nichtdeklarierter Bezeichner
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(32) : error C2065: 'token' : nichtdeklarierter Bezeichner
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(32) : error C2165: 'left-side modifier' : Zeiger auf Daten koennen nicht veraendert werden
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(32) : error C2071: 'NotificationHookProc' : ungueltige Speicherklasse
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(33) : error C2146: Syntaxfehler : Fehlendes ')' vor Bezeichner 'token'
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(33) : error C2165: 'left-side modifier' : Zeiger auf Daten koennen nicht veraendert werden
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(33) : error C2071: 'NotificationUnhookProc' : ungueltige Speicherklasse
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(33) : error C2059: Syntaxfehler : ')'
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(86) : error C2059: Syntaxfehler : 'const'
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(95) : error C2146: Syntaxfehler : Fehlendes ')' vor Bezeichner 'token'
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(95) : warning C4229: Anachronismus verwendet : Modifizierer der Daten werden ignoriert
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(95) : error C2182: 'GdiplusShutdown' : Ungueltige Verwendung des Typs 'void'
      c:\programme\microsoft platform sdk\include\gdiplusinit.h(95) : error C2059: Syntaxfehler : ')'
      c:\programme\microsoft platform sdk\include\gdiplusflat.h(2639) : warning C4229: Anachronismus verwendet : Modifizierer der Daten werden ignoriert
      c:\programme\microsoft platform sdk\include\gdiplusflat.h(2639) : error C2440: 'initializing' : 'int' kann nicht in 'enum Gdiplus::Status' konvertiert werden
      Konvertierung in einen Aufzaehlungstypen erfordert explizite Typumwandlung (static_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat)
      c:\programme\microsoft platform sdk\include\gdiplusflat.h(2644) : error C2146: Syntaxfehler : Fehlendes ')' vor Bezeichner 'token'
      c:\programme\microsoft platform sdk\include\gdiplusflat.h(2644) : warning C4229: Anachronismus verwendet : Modifizierer der Daten werden ignoriert
      c:\programme\microsoft platform sdk\include\gdiplusflat.h(2644) : error C2182: 'GdiplusNotificationUnhook' : Ungueltige Verwendung des Typs 'void'
      c:\programme\microsoft platform sdk\include\gdiplusflat.h(2644) : error C2059: Syntaxfehler : ')'
      h:\xmenu code\vc++\main.cpp(150) : error C2360: Initialisierung von 'pen' durch 'case'-Marke übersprungen
      h:\xmenu code\vc++\main.cpp(139) : Siehe Deklaration von 'pen'
      h:\xmenu code\vc++\main.cpp(150) : error C2360: Initialisierung von 'graphics' durch 'case'-Marke übersprungen
      h:\xmenu code\vc++\main.cpp(138) : Siehe Deklaration von 'graphics'
      h:\xmenu code\vc++\main.cpp(153) : error C2360: Initialisierung von 'pen' durch 'case'-Marke übersprungen
      h:\xmenu code\vc++\main.cpp(139) : Siehe Deklaration von 'pen'
      h:\xmenu code\vc++\main.cpp(153) : error C2360: Initialisierung von 'graphics' durch 'case'-Marke übersprungen
      h:\xmenu code\vc++\main.cpp(138) : Siehe Deklaration von 'graphics'
      h:\xmenu code\vc++\main.cpp(156) : error C2360: Initialisierung von 'pen' durch 'case'-Marke übersprungen
      h:\xmenu code\vc++\main.cpp(139) : Siehe Deklaration von 'pen'
      h:\xmenu code\vc++\main.cpp(156) : error C2360: Initialisierung von 'graphics' durch 'case'-Marke übersprungen
      h:\xmenu code\vc++\main.cpp(138) : Siehe Deklaration von 'graphics'
      h:\xmenu code\vc++\main.cpp(159) : error C2361: Initialisierung von 'pen' durch 'default'-Marke übersprungen
      h:\xmenu code\vc++\main.cpp(139) : Siehe Deklaration von 'pen'
      h:\xmenu code\vc++\main.cpp(159) : error C2361: Initialisierung von 'graphics' durch 'default'-Marke übersprungen
      h:\xmenu code\vc++\main.cpp(138) : Siehe Deklaration von 'graphics'
      Fehler beim Ausführen von cl.exe.

      main.obj - 24 Fehler, 3 Warnung(en)

      those are the VC++ errors
      obviously it's the german version

      if i change the include lines from

      include <windows.h>

      include <gdiplus.h>

      to

      include <gdiplus.h>

      include <windows.h>

      i get totally different errors:
      --------------------Konfiguration: main - Win32 Debug--------------------
      Kompilierung läuft...
      main.cpp
      c:\programme\microsoft platform sdk\include\gdiplusenums.h(28) : error C2146: Syntaxfehler : Fehlendes ';' vor Bezeichner 'GraphicsState'
      c:\programme\microsoft platform sdk\include\gdiplusenums.h(28) : fatal error C1004: Unerwartetes Dateiende gefunden
      Fehler beim Ausführen von cl.exe.

      main.obj - 2 Fehler, 0 Warnung(en)

      i dont think u need any source code (there is not much there anyway); the errors are caused by the include statements :s

       
    • Anonymous

      Anonymous - 2006-04-19

      >> i now tried Visual C++ and it returns similar errors :(

      They don't look very similar to at all! You also omitted to tell us what version of VC++ you are using. The version of the SDK may also be useful.

      Using VC++ 2005 Express Edition (which is currently a free download BTW), with the PSDK added according to the directions in the link on the Visual Studio Start Page to allow Win32 code generation I compiled the following code without errors:

      include <windows.h>

      include <gdiplus.h>

      int main()
      {
      }

      Clifford

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.