SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: Allegro and MSVC, please help...
Hybrid View
-
Dec 21, 2000, 04:10 #1
- Join Date
- Apr 2000
- Location
- Los Angeles, California
- Posts
- 1,008
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Edit:
Problem fixed...see new post by me below, with my new problems.
<Edited by jumpthru on 12-22-2000 at 04:33 PM>
-
Dec 22, 2000, 11:54 #2
-
Dec 22, 2000, 16:32 #3
- Join Date
- Apr 2000
- Location
- Los Angeles, California
- Posts
- 1,008
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This is what I have done so far.
Unzipped djdev203.zip, gcc2952b.zip, gpp2952b.zip, lgp2952b.zip, bnu2951b.zip, mak3791b.zip into c:\djgpp
Unzipped all3933.zip into c:\djgpp\allegro
Ran vcvars32.bat
Ran fixmsvc.bat
Now, if you run "make all" it will get an error saying "C:\djgpp\allegro\obj\djgpp\asmdef.inc can not be found." That file is called from "C:\djgpp\allegro\src\i386\asmdefs.inc" The error is caused because that file (C:\djgpp\allegro\src\i386\asmdefs.inc) is not updated when you run fixmsvc.bat, and instead of calling "C:\djgpp\allegro\obj\MSVC\asmdef.inc" it calls "C:\djgpp\allegro\obj\DJGPP\asmdef.inc"
This error can be avoided by manually changing the line that calls "C:\djgpp\allegro\obj\DJGPP\asmdef.inc" to "C:\djgpp\allegro\obj\MSVC\asmdef.inc"
I now ran "make all" again. I now get an error saying something about DCAPS not found. That error is fixed by unzipping the DirectX 8.0 SDK files into "C:\Program Files\Microsoft Visual Studio\VC98" Those files include a setup program, but even though I didn't run the setup program, the above stated error (about DCAPS) is now avoided.
Now I can run "make all" without any errors. I then run "make installall" without any errors.
I then add "alld.lib" to the link line in Project->Settings under Win32 Debug and "alleg.lib" to the link line in Project->Settings under Win32 Release.
The reason I ran "make all" and "make installall" instead of just "make" and "make install" is because unless I do, "alld.lib" is not created, and I get an error when I try and compile a program in MSVC 6.0.
So now I try to run the attached code (at the bottom), and I get the error "--------------------Configuration: Test - Win32 Release--------------------
Compiling...
test.cpp
Linking...
LIBC.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Release/Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Test.exe - 2 error(s), 0 warning(s)"
It doesn't matter whether I change Build->Set Active Configuration to either Win32 Release or Win32 Debug, I get the same error.
This is very frusterating, and I will probably fail my c++ programming class unless I can get this working. The code I was trying to run is attached at the bottom, but I get that same error with any code I have tried (and all the code I have tried are copy and pasted, from example files included).
What do you think is the problem? Thanks.
Nate
Code I am trying to run
-----------------------
#include <allegro.h>
int main(int argc, char *argv[])
{
char string[] = "Hello World";
int midpoint = 0;
install_allegro(SYSTEM_AUTODETECT, &errno, atexit);
if(install_keyboard())
{
allegro_exit();
allegro_message("Error installing keyboard "
"handler.\nExiting");
return -1;
}
set_color_depth(8);
if(0 > set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0))
{
allegro_exit();
allegro_message("Error setting graphics "
"mode.\nExiting");
return -1;
}
clear(screen);
midpoint = (SCREEN_W - text_length(font, string)) / 2;
textout(screen, font, string,
midpoint, SCREEN_H / 2,makecol(255, 0, 0));
readkey();
return 0;
}
END_OF_MAIN();
-
Dec 23, 2000, 00:48 #4
- Join Date
- Apr 2000
- Location
- Los Angeles, California
- Posts
- 1,008
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Okay, it was fixed by a geinous at http://www.dlsproductions.com, who searched some mailing lists and found others with the same problem. It was fixed by adding #define USE_CONSOLE above the #include <allegro.h> (if you are building a Win32 Console Application in MSVC).
It worked, so for anyone else having this problem, do that. I am so happy it worked! Ooooh yea. Happy holidays everyone!
Bookmarks