Thread: strange error!?

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    479

    strange error!?

    hi
    today i got my msvc to work with allegro
    (i use used dev-4 b4)

    when i compiled my file
    i get the following errors:


    Code:
    
    --------------------Configuration: playsound - Win32 Debug--------------------
    Compiling...
    playsound.cpp
    c:\program files\microsoft visual studio\vc98\include\allegro\system.h(29) : error C2371: 'BITMAP' : redefinition; different basic types
            c:\program files\microsoft visual studio\vc98\include\wingdi.h(486) : see declaration of 'BITMAP'
    c:\temp\playsound_cpp\playsound\playsound.cpp(378) : error C2731: 'WinMain' : function cannot be overloaded
            c:\temp\playsound_cpp\playsound\playsound.cpp(378) : see declaration of 'WinMain'
    Error executing cl.exe.
    
    playsound.obj - 2 error(s), 0 warning(s)


    i've included:

    #include <windows.h>


    #include <time.h>
    #include <allegro.h>
    #include <mmsystem.h>

    and i've linked to winmm.lib
    to use playsound();
    anyone know what is wrong??

    thanks

  2. #2
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    Usually showing what your code is helps...

    EDIT: Are you sure you're linking to Allegro properly, and that you're declaring all of your Allegro functions accordingly?
    Last edited by TechWins; 12-25-2002 at 11:01 PM.

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    sorry i cant include the code here
    its too big besides its not my sourcecode that makes these errors.

    #include <time.h>
    #include <allegro.h>
    #include <mmsystem.h>
    #include <windows.h>

    #pragma comment(lib, "winmm.lib")

    #pragma comment(lib, "alleg.lib")

    my program works perfectly when i dont include #include <mmsystem.h> &
    #include <windows.h>
    and dont call function playsound()
    now when i compiled it again i get these errors:

    Code:
    --------------------Configuration: spel - Win32 Debug--------------------
    Compiling...
    pode.cpp
    c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'
    c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : fatal error C1004: unexpected end of file found
    Error executing cl.exe.
    
    pode.obj - 2 error(s), 0 warning(s)
    they both point to a line in mmsystem.h

    Code:
    #ifndef MM_MIDI_MAPPER
    #define MM_MIDI_MAPPER          1   /* MIDI Mapper */
    #define MM_WAVE_MAPPER          2   /* Wave Mapper */
    #define MM_SNDBLST_MIDIOUT      3   /* Sound Blaster MIDI output port */
    #define MM_SNDBLST_MIDIIN       4   /* Sound Blaster MIDI input port */
    #define MM_SNDBLST_SYNTH        5   /* Sound Blaster internal synthesizer */
    #define MM_SNDBLST_WAVEOUT      6   /* Sound Blaster waveform output */
    #define MM_SNDBLST_WAVEIN       7   /* Sound Blaster waveform input */
    #define MM_ADLIB                9   /* Ad Lib-compatible synthesizer */
    #define MM_MPU401_MIDIOUT      10   /* MPU401-compatible MIDI output port */
    #define MM_MPU401_MIDIIN       11   /* MPU401-compatible MIDI input port */
    #define MM_PC_JOYSTICK         12   /* Joystick adapter */
    #endif
    #endif
    
    /* general data types */
    
    #ifdef _WIN32
    typedef UINT        MMVERSION;  /* major (high byte), minor (low byte) *///here is the error??
    #else
    
    typedef UINT        VERSION;    /* major (high byte), minor (low byte) */
    #endif
    typedef UINT        MMRESULT;   /* error return code, 0 means no error */
    				/* call as if(err=xxxx(...)) Error(err); else */
    #define _MMRESULT_
    
    typedef UINT FAR   *LPUINT;
    
    /* MMTIME data structure */
    asi said b4 this is from the include file
    mmsystem.h
    i've never touched it and im sure no one else has either cause i installed
    my msvc yesterday
    if someone can find the same lines in his file and post to me if its the same?
    i would be very thankful

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    You want to use PlaySound() right? Then it's not nessecary to
    include mmsystem.h

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  2. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM