Error: redefinition of typedef xxxx

This is a discussion on Error: redefinition of typedef xxxx within the C Programming forums, part of the General Programming Boards category; Hello, I'm trying to compile my .C and I got this errors... The header file (gauge.h) is a SDK of ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Location
    Fortaleza
    Posts
    6

    Question Error: redefinition of typedef xxxx

    Hello, I'm trying to compile my .C and I got this errors... The header file (gauge.h) is a SDK of a game (from Micro$oft).

    I opened the file and preprocessor tags for preventing twice include has been found.
    Any Idea? The header I'm using can be found here: http://pastebin.com/m6b3d71cf just to show you the lines I'm gettting errors

    Thanks for reading my thread even you can't help me.

    Code:
    #ifndef GAUGE_H__
    #define GAUGE_H__
    
    ...
    
    #endif
    Code:
    C:\beep\beep\gauge.h|5114|error: redefinition of typedef 'PELEMENT_STATIC_IMAGE'|
    C:\beep\beep\gauge.h|5076|error: previous declaration of 'PELEMENT_STATIC_IMAGE' was here|
    C:\beep\beep\gauge.h|5114|error: redefinition of typedef 'PPELEMENT_STATIC_IMAGE'|
    C:\beep\beep\gauge.h|5076|error: previous declaration of 'PPELEMENT_STATIC_IMAGE' was here|
    C:\beep\beep\gauge.h|5167|error: redefinition of typedef 'PELEMENT_NEEDLE'|
    C:\beep\beep\gauge.h|5077|error: previous declaration of 'PELEMENT_NEEDLE' was here|
    C:\beep\beep\gauge.h|5167|error: redefinition of typedef 'PPELEMENT_NEEDLE'|
    C:\beep\beep\gauge.h|5077|error: previous declaration of 'PPELEMENT_NEEDLE' was here|
    C:\beep\beep\gauge.h|5270|error: redefinition of typedef 'PELEMENT_STRING'|
    C:\beep\beep\gauge.h|5078|error: previous declaration of 'PELEMENT_STRING' was here|
    C:\beep\beep\gauge.h|5270|error: redefinition of typedef 'PPELEMENT_STRING'|
    C:\beep\beep\gauge.h|5078|error: previous declaration of 'PPELEMENT_STRING' was here|
    C:\beep\beep\gauge.h|5363|error: redefinition of typedef 'PELEMENT_SLIDER'|
    C:\beep\beep\gauge.h|5079|error: previous declaration of 'PELEMENT_SLIDER' was here|
    C:\beep\beep\gauge.h|5363|error: redefinition of typedef 'PPELEMENT_SLIDER'|
    C:\beep\beep\gauge.h|5079|error: previous declaration of 'PPELEMENT_SLIDER' was here|
    C:\beep\beep\gauge.h|5430|error: redefinition of typedef 'PELEMENT_ICON'|
    C:\beep\beep\gauge.h|5080|error: previous declaration of 'PELEMENT_ICON' was here|
    C:\beep\beep\gauge.h|5430|error: redefinition of typedef 'PPELEMENT_ICON'|
    C:\beep\beep\gauge.h|5080|error: previous declaration of 'PPELEMENT_ICON' was here|
    C:\beep\beep\gauge.h|5503|error: redefinition of typedef 'PELEMENT_MOVING_IMAGE'|
    C:\beep\beep\gauge.h|5081|error: previous declaration of 'PELEMENT_MOVING_IMAGE' was here|
    C:\beep\beep\gauge.h|5503|error: redefinition of typedef 'PPELEMENT_MOVING_IMAGE'|
    C:\beep\beep\gauge.h|5081|error: previous declaration of 'PPELEMENT_MOVING_IMAGE' was here|
    C:\beep\beep\gauge.h|5588|error: redefinition of typedef 'PELEMENT_SPRITE'|
    C:\beep\beep\gauge.h|5082|error: previous declaration of 'PELEMENT_SPRITE' was here|
    C:\beep\beep\gauge.h|5588|error: redefinition of typedef 'PPELEMENT_SPRITE'|
    C:\beep\beep\gauge.h|5082|error: previous declaration of 'PPELEMENT_SPRITE' was here|
    C:\beep\beep\gauge.h|5863|warning: useless keyword or type name in empty declaration|
    C:\beep\beep\gauge.h|5960|warning: useless keyword or type name in empty declaration|
    ||=== Build finished: 28 errors, 4 warnings ===|

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    There are two definitions of PELEMENT_STATIC_IMAGE in that file. Don't ask me why, but if there are two definitions of the same typedef, then I'd expect the compiler to give that error.

    If you go to line 5076, and make that about the top of the screen, you can see line 5114 which defines the same type again.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User slingerland3g's Avatar
    Join Date
    Jan 2008
    Location
    Seattle
    Posts
    602
    You may want to check for any missing ';' as well that ends a 'c' statement.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Need help understanding info in a header file
    By hicpics in forum C Programming
    Replies: 8
    Last Post: 12-02-2005, 11:36 AM
  3. Please STICKY this- vital to MSVC 6 dev - BASETSD.h
    By VirtualAce in forum Game Programming
    Replies: 11
    Last Post: 03-15-2005, 08:22 AM
  4. build errors migrated from dx9b to dx9c sdk
    By reanimated in forum Game Programming
    Replies: 4
    Last Post: 12-17-2004, 06:35 AM
  5. oh me oh my hash maps up the wazoo
    By DarkDays in forum C++ Programming
    Replies: 5
    Last Post: 11-30-2001, 11:54 AM

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