[Allegro, C++] Problem z dołączeniem dll'ek
Ostatnio zmodyfikowano 2011-08-27 16:15
Trix Temat założony przez niniejszego użytkownika |
[Allegro, C++] Problem z dołączeniem dll'ek » 2011-08-26 23:22:23 Używany kompilator: Visual Studio 2010 Express Sam troszkę pokombinowałem i udało mi się dołączyć allegro do tego programu. Co zrobiłem? -Pobrałem pliki allegro pod wersję VS2010 -Foldery include, lib wkleiłem do: główny folder z kompilatorem->VC -Zmieniłem nazwę folderu allegro5... znajdujący się w include na allegro5 -Dll'ki z folderu bin wkleiłem do system32 -Uruchomiłem kompilator -Dodąłem wpis w Linker>Input Additional Dependencies : allegro-5.0.4-monolith-md-debug.lib; Kod skompilował się poprawnie (ten): #include <stdio.h> #include <allegro5/allegro.h>
int main( int argc, char ** argv ) { ALLEGRO_DISPLAY * display = NULL; if( !al_init() ) { fprintf( stderr, "failed to initialize allegro!\n" ); return - 1; } display = al_create_display( 640, 480 ); if( !display ) { fprintf( stderr, "failed to create display!\n" ); return - 1; } al_clear_to_color( al_map_rgb( 0, 0, 0 ) ); al_flip_display(); al_rest( 10.0 ); al_destroy_display( display ); return 0; } Lecz inny kod (gotowiec) juz nie działa: #include <stdio.h> #include <allegro5/allegro.h>
int main() { allegro_init(); install_keyboard(); set_color_depth( 8 ); set_gfx_mode( GFX_AUTODETECT, 800, 600, 0, 0 ); set_palette( default_palette ); clear_to_color( screen, 48 ); textout_ex( screen, font, "Witaj w Allegro !", 20, 20, makecol( 255, 0, 255 ), - 1 ); readkey(); allegro_exit(); return 0; } END_OF_MAIN();
Błędy: ------ Build started: Project: Test allegro, Configuration: Debug Win32 ------ main.cpp c:\programy w c++\test allegro\test allegro\main.cpp(7): error C3861: 'allegro_init': identifier not found c:\programy w c++\test allegro\test allegro\main.cpp(8): error C3861: 'install_keyboard': identifier not found c:\programy w c++\test allegro\test allegro\main.cpp(9): error C3861: 'set_color_depth': identifier not found c:\programy w c++\test allegro\test allegro\main.cpp(10): error C2065: 'GFX_AUTODETECT' : undeclared identifier c:\programy w c++\test allegro\test allegro\main.cpp(10): error C3861: 'set_gfx_mode': identifier not found c:\programy w c++\test allegro\test allegro\main.cpp(11): error C2065: 'default_palette' : undeclared identifier c:\programy w c++\test allegro\test allegro\main.cpp(11): error C3861: 'set_palette': identifier not found c:\programy w c++\test allegro\test allegro\main.cpp(12): error C2065: 'screen' : undeclared identifier c:\programy w c++\test allegro\test allegro\main.cpp(12): error C3861: 'clear_to_color': identifier not found c:\programy w c++\test allegro\test allegro\main.cpp(13): error C2065: 'screen' : undeclared identifier c:\programy w c++\test allegro\test allegro\main.cpp(13): error C2065: 'font' : undeclared identifier c:\programy w c++\test allegro\test allegro\main.cpp(13): error C3861: 'textout_ex': identifier not found c:\programy w c++\test allegro\test allegro\main.cpp(13): error C3861: 'makecol': identifier not found c:\programy w c++\test allegro\test allegro\main.cpp(15): error C3861: 'readkey': identifier not found c:\programy w c++\test allegro\test allegro\main.cpp(17): error C3861: 'allegro_exit': identifier not found c:\programy w c++\test allegro\test allegro\main.cpp(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
|
Gabes |
» 2011-08-26 23:40:23 |
|
Trix Temat założony przez niniejszego użytkownika |
» 2011-08-27 14:55:21 Ok działa, a z tym tutorialem to coś mało informacji jest, tylko rzuciłem okiem, więc może się mylę :)
Czym różni się allegro4 od 5? Jakie nowości są wprowadzone? Bo może będę operowął na 4 :) |
|
SeaMonster131 |
» 2011-08-27 16:15:00 Czym sie różni? No prawie wszystkim :) Jest lepsze (np chociażby nie trzeba samemu pisać 2(lub więcej) -nego buforowania), jest wydajniejsze :)
Pisałem w 4 oraz 5. Teraz piszę tylko w 5 :) |
|
« 1 » |