Trying to compile with allegro... i linked the lib file...
it compiles but when I click excute (mvc++) it gives me that error
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Trying to compile with allegro... i linked the lib file...
it compiles but when I click excute (mvc++) it gives me that error
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
I don't think allegro is supposed to be with MSVC++
yes allegro works with MVC++ it use it with mvc++ my self. Heres some things to check first the proper lib files (alleg.lib and allp.lib(for the release version) or alld.lib (for the debug version) must be included in the project file. Secondly you must have the dll file in the folder the projects in (there is some way around this but puting the dll file in the folder is quicker).
C:\Programming\C++\allegro\sheeprpg.cpp(23) : error C2664: 'load_bitmap' : cannot convert parameter 2 from 'struct RGB (*)[256]' to 'struct RGB *'Code:#include <allegro.h> // Create memory buffer and palette. BITMAP *Buffer; PALETTE *Pal; int main() { // Initialize Allegro. allegro_init(); // Where 24 is the color depth in bits. set_color_depth(24); // Set the resolution to 640 by 480 with SAFE autodetection. set_gfx_mode(GFX_SAFE, 640, 480, 0, 0); // Setup the sound routines. install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, 0); // Installing the keyboard handler. install_keyboard(); // Load the picture from disk into the Buffer. Buffer = load_bitmap("MyPicture.bmp", Pal); // Draw or "flush" buffer onto the screen. draw_sprite(screen, Buffer, 0, 0); // Pause program until escape pressed. textout(screen, font, "Press ESCape to quit.", 1, 1, makecol(255,255,255)); while(! key[KEY_ESC]) ; // Shut down and clean up. destroy_bitmap(Buffer); allegro_exit(); return 0; } // End of main function. // Some Allegro magic to deal with WinMain(). END_OF_MAIN();
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
whats wrong now?
try allocating for it
PALETTE *Pal = new PALLETTE;
that gives even more erros
I think its looking for a winmain() not a main(). (or visa versa)
TO do with the way you made the project, win32 console or win32 app.
Try a search or look at
http://www.cprogramming.com/cboard/s...hlight=LNK2001
and see if Adrianxw solution works in your case.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
More errors or not you still need to point the pointers to something, they can cause memory overwrites and program crashes, among other things, if you dont.
>>
error LNK2001: unresolved external symbol _main
<<
Add:
END_OF_MAIN();
after the end of your main function to resolve this.
theres an error in that faq Buffer = load_bitmap("MyPicture.bmp", Pal); should be
Buffer = load_bitmap("MyPicture.bmp", &Pal);
if you look carefull enough its already there... after putting the &Pal i get this:Originally posted by Unregistered
>>
error LNK2001: unresolved external symbol _main
<<
Add:
END_OF_MAIN();
after the end of your main function to resolve this.
C:\Programming\C++\allegro\sheeprpg.cpp(20) : error C2664: 'load_bitmap' : cannot convert parameter 2 from 'struct RGB (** )[256]' to 'struct RGB *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
this isnt a windows aplliction, i just made a .cpp file and trying to compile it in a empty workspace
thats your problem you need to create a new win32 project(non mfc) and then add the source file and compile it.
did you include the *.lib files in the project settings dialogue?
goto Project > Settings Click on the Link tab and where it says Object/Library Modules, goto the very end of that and put in: alld.lib alleg.lib allp.lib
Cool, a sheep RPG.C:\Programming\C++\allegro\sheeprpg.cpp
Hope the problem was fixed, I wanna play it when it's done.
Allegro precompiled Installer for Dev-C++, MSVC, and Borland: http://galileo.spaceports.com/~springs/