Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Compiling Allegro for use with CodeBlocks

This thread is locked; no one can reply to it. rss feed Print
Compiling Allegro for use with CodeBlocks
SpectreNectar
Member #10,969
May 2009
avatar

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
Second in Command
February 2005
avatar

SpectreNectar
Member #10,969
May 2009
avatar

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

Arthur Kalliokoski
Second in Command
February 2005
avatar

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.

They all watch too much MSNBC... they get ideas.

SpectreNectar
Member #10,969
May 2009
avatar

I forgot to mention that I've downloaded 4.2.2

Arthur Kalliokoski
Second in Command
February 2005
avatar

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

They all watch too much MSNBC... they get ideas.

SpectreNectar
Member #10,969
May 2009
avatar

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
Second in Command
February 2005
avatar

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)

They all watch too much MSNBC... they get ideas.

SpectreNectar
Member #10,969
May 2009
avatar

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
Second in Command
February 2005
avatar

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"?

They all watch too much MSNBC... they get ideas.

SpectreNectar
Member #10,969
May 2009
avatar

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
Second in Command
February 2005
avatar

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

They all watch too much MSNBC... they get ideas.

SpectreNectar
Member #10,969
May 2009
avatar

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

Arthur Kalliokoski
Second in Command
February 2005
avatar

<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?

They all watch too much MSNBC... they get ideas.

SpectreNectar
Member #10,969
May 2009
avatar

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

Thomas Fjellstrom
Member #476
June 2000
avatar

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.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

SpectreNectar
Member #10,969
May 2009
avatar

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
Member #9,752
May 2008
avatar

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.

________________________________________________________________________________________________________
[freedwill.us]
[unTied Games]

Arthur Kalliokoski
Second in Command
February 2005
avatar

They all watch too much MSNBC... they get ideas.

SpectreNectar
Member #10,969
May 2009
avatar

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

Go to: