Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    [c++] problema con allegro4

    codice:
    #include <allegro.h>
    #include <stdio.h>
    #include <string.h>
    
    int main()
    {
          int x=10,y=10;
          int depth;
          allegro_init();
          set_window_title("allegro");
          
          install_keyboard();
          install_timer();
          install_mouse();
          install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, 0);
          
          depth = desktop_color_depth();
          set_color_depth ( depth );
    
          set_gfx_mode(GFX_AUTODETECT_WINDOWED, 800, 600, 0, 0);
    
          BITMAP *background;
          PALETTE prova;
          
          background = load_bitmap("background_1.bmp",prova);
    
          masked_blit(background,screen,0,0,0,0,800,600);
          
          while(!key[KEY_ESC])
          {
        
          }
          
    
    return 0;
    }
    END_OF_MAIN()
    quando compilo, il compilatore mi segna errore, probabilmente su
    codice:
          BITMAP *background;
          PALETTE prova;
          
          background = load_bitmap("background_1.bmp",prova);
    
          blit(background,screen,0,0,0,0,800,600);
    E DICE:
    multiple definition of `_mangled_main()'
    first defined here
    multiple definition of `WinMain@16'
    first defined here
    ld returned 1 exit status
    c:\percorso del file...\Makefile.win [Build Error] [game.exe] Error 1


    qualcuno può spiegarmi perché?? grazie in anticipo.

  2. #2
    Utente di HTML.it L'avatar di linoma
    Registrato dal
    Mar 2010
    Messaggi
    1,346
    E' solo questo il codice? Prova a spostare le variabili
    codice:
          BITMAP *background;
          PALETTE prova;
    appena la graffa di main.
    Per gli Spartani e Sparta usa spartan Il mio github

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.