Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Problem compiling allegro 4.0

This thread is locked; no one can reply to it. rss feed Print
Problem compiling allegro 4.0
ophelius
Member #6,949
February 2006
avatar

I'm following the instructions for msvc6 but getting some errors. Here are the instructions for reference: http://wiki.allegro.cc/index.php?title=Build/MSVC_6

The first error I encounter is when I use 'fix.bat msvc'.
Here's what the console displays:

"Configuring Allegro for Windows/MSVC..."
"Configuring Allegro files to DOS CR/LF format..."
"'utod' is not recognized as an internal or external command,.."
[error repeated twice]
"Done!"

Then the 'make all staticlink=1' command works for many files/commands until it reaches this error:

"gcc -Wall -I. -I./include -x assembler-with-cpp -o obj/msvc/alleg/icpus.obj -c src/i386/icpus.s"
"src/i386/icpus.s: Assembler messages:"
"src/i386/icpus.s:70: Error: suffix or operands invalid for 'fnstsw'"
"make[1]: *** [obj/msvc/alleg/icpus.obj] Error 1"
"make[1]: Leaving directory 'c:\allegro'"
"make: *** [all] Error 2"

Then if I try any of the other steps, I get the same message and nothing else.

Maybe it's the version of MinGW? I downloaded 5.1.6. I renamed the Make to make.exe because it had a longer name, but that shouldn't matter.

Any ideas?

Matthew Leverton
Supreme Loser
January 1999
avatar

What version are you really using? 4.2.2, 4.2.3, 4.4.0, etc. Anyway, see this.

Also, MSVC 6 is older than dirt. You should consider upgrading to anything else.

ophelius
Member #6,949
February 2006
avatar

Sweet, that worked. In the src/i386/icpus.s I had to change 'fnstsw %eax' to 'fnstsw %ax'. Then it compiled fine. Thank you!

Evert
Member #794
November 2000
avatar

Do you have a good reason for using such an old version of Allegro?

Matthew Leverton
Supreme Loser
January 1999
avatar

He's using FreeBASIC.

Edit.

Try the attached DLL.

The updated code looks like:

src/win/wwnd.c#SelectExpand
1#include "allegro.h" 2#include "allegro/internal/aintern.h" 3#include "allegro/platform/aintwin.h" 4#include "wddraw.h" 5 6/* ... */ 7 8 switch (message) { 9 case WM_QUERYNEWPALETTE: 10 case WM_PALETTECHANGED: 11 if ((HWND)wparam != wnd && dd_prim_surface) { 12 IDirectDrawSurface2_SetPalette(dd_prim_surface, dd_palette); 13 InvalidateRect(wnd, NULL, 1); 14 } 15 return 0; 16 17 case WM_CREATE:

ophelius
Member #6,949
February 2006
avatar

Thanks for that! Though I tried this version, but now my game compiles, but crashes :(

Here's what my compiler says:
Info: resolving _install_joystick by linking to __imp__install_joystick (auto-import)
Info: resolving _vsync by linking to __imp__vsync (auto-import)
Info: resolving _masked_blit by linking to __imp__masked_blit (auto-import)
Info: resolving _floodfill by linking to __imp__floodfill (auto-import)

It seems those functions don't work with this version. I was using allegro 4.0.3.0 if that helps. I'll try to compile this new code into my version to see if that helps.

Your post should have been posted here though: http://www.allegro.cc/forums/thread/603839/1

Edit:
hmmm, the newly compiled 4.0.3.0 source from sourceforge also makes my game crash with the same errors as above. I doubt it's because of the new lines. I don't know why my original dll file works. There's a size difference:

My original working 4.0.3.0 dll file->219KB

The new 4.0.3.0 dll file->536KB

I wonder where my original came from??

Go to: