Compiling Allegro for use with CodeBlocks
SpectreNectar

I have been following this tutorial: http://wiki.allegro.cc/index.php?title=Code::Blocks
I get the following error when writing MINGW32-MAKE.EXE while in the mingw\allegro directory, as told:

Error: suffix or operands invalid for 'fnstsw'

I'm not sure what this error means.
Help would be much appreciated.

- Niels

Arthur Kalliokoski
SpectreNectar

I found a fix called fnstsw %ax
But I still don't know what to do with it :-/

Arthur Kalliokoski

I found a file allegro/src/i386/icpus.s that has a line "fnstsw %eax", if that's changed to "fnstsw %ax" it might work.

This is Allegro 4.2.0 btw.

SpectreNectar

I forgot to mention that I've downloaded 4.2.2

Arthur Kalliokoski

So can you search (preferably using grep or something better than explorer search) to find "fnstsw %eax"?

SpectreNectar

I changed the line as you suggested and now I'm stuck at MINGW32-MAKE.EXE install

It says (In my own language): access denied, 0 files were copied
mingw32-make.exe: *** c:\windows\system32\alleg32.dll Error 1

This is really frustrating. Thank you so far.

Arthur Kalliokoski

You have to have administrator privileges to be able to copy alleg*.dll to \windows\system32.

Maybe switch to administrator and try "make install" again (it should pick up where it left off at the error)

SpectreNectar

That's another thing I forgot to mention. I use windows vista
And this is the only user on the computer. It shold have those provileges.
How do I change the folder settings of system32 as I suppose that's what I need to do? Vista really confuse me.

Arthur Kalliokoski

What does "Start | User Accounts | Manage Accounts" say? If it wants a password to get to that screen, it's asking for administrator password, else you should see icons for all possible users. Do any of them say "Administrator" or do they say "Standard user" or "... account is off"?

SpectreNectar

The one I'm using says Administrator.
The other one is the guest account.
I'm sorry for the late replies but my Internet connection is acting out.

Arthur Kalliokoski

I don't know why make couldn't install then. Go to the directory that has "alleg32.dll" etc. (probably allegro/lib/mingw32), hold shift down and right click off to the right side, and see if you can get a "Open Command Window Here" to click on. Once there, type in "copy *.dll c:\windows\system32" and hit enter. If it says "1 file(s) copied" or more then you're all set.

Really though, you should create a Standard User account for normal use and especially before surfing the intrawebs :-X

SpectreNectar

Access denied again.
Also, the name of the dll is alleg42.dll
???

Arthur Kalliokoski

<sigh> You have lost... Try downloading and burning one of the Linux live CD's and see if you can copy it with that.

Alternatively, you might temporarily copy alleg32.dll to the directory where your exe's are?

SpectreNectar

I tried copying the dll to my system32 folder without the command prompt. Will that work?

Thomas Fjellstrom

When starting the cmd window, go to the start menu, type in "cmd" and hit CTRL+SHIFT+ENTER instead of just enter, and cd back to the allegro dir, and run your make install.

SpectreNectar

Great! I'm through compiling Allegro, but I can't build the hello world example.
It says

obj\Debug\main.o||In function `mangled_main':|
C:\C++\mig4\main.c|16|undefined reference to `_install_allegro_version_check'|
C:\C++\mig4\main.c|20|undefined reference to `install_keyboard'|
C:\C++\mig4\main.c|23|undefined reference to `set_gfx_mode'|
C:\C++\mig4\main.c|24|undefined reference to `set_gfx_mode'|
C:\C++\mig4\main.c|25|undefined reference to `set_gfx_mode'|
C:\C++\mig4\main.c|26|undefined reference to `_imp__allegro_error'|
C:\C++\mig4\main.c|26|undefined reference to `allegro_message'|
C:\C++\mig4\main.c|32|undefined reference to `_imp__desktop_palette'|
C:\C++\mig4\main.c|32|undefined reference to `set_palette'|
C:\C++\mig4\main.c|35|undefined reference to `makecol'|
C:\C++\mig4\main.c|35|undefined reference to `_imp__screen'|
C:\C++\mig4\main.c|35|undefined reference to `clear_to_color'|
C:\C++\mig4\main.c|41|undefined reference to `acquire_screen'|
C:\C++\mig4\main.c|44|undefined reference to `makecol'|
C:\C++\mig4\main.c|44|undefined reference to `_imp__gfx_driver'|
C:\C++\mig4\main.c|44|undefined reference to `_imp__gfx_driver'|
C:\C++\mig4\main.c|44|undefined reference to `_imp__gfx_driver'|
C:\C++\mig4\main.c|44|undefined reference to `_imp__gfx_driver'|
C:\C++\mig4\main.c|44|undefined reference to `_imp__font'|
C:\C++\mig4\main.c|44|undefined reference to `_imp__screen'|
C:\C++\mig4\main.c|44|undefined reference to `textout_centre_ex'|
C:\C++\mig4\main.c|47|undefined reference to `release_screen'|
C:\C++\mig4\main.c|50|undefined reference to `readkey'|
obj\Debug\main.o||In function `WinMain':|
C:\C++\mig4\main.c|55|undefined reference to `_WinMain'|
||=== Build finished: 24 errors, 0 warnings ===|

Schyfis

It looks like you need to add liballeg.a to your linker settings.
Go to Project, then Build Options, then the Linker Settings tab. Click the add button, locate liballeg.a, and click OK.

Arthur Kalliokoski
SpectreNectar

Thank you! you guys are awesome.
I now have a working program ;D

Thread #600256. Printed from Allegro.cc