Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Error with CodeBlock 8.02 and allegro 4.2.2

This thread is locked; no one can reply to it. rss feed Print
Error with CodeBlock 8.02 and allegro 4.2.2
dfighter
Member #12,495
January 2011

Hello,
i'm sorry to post that, but i really searched and i can't find what's wrong...

I firstly followed that steps:
http://wiki.allegro.cc/index.php?title=Code::Blocks

But when i have to do this :

"Now allegro can be compiled by typing in the command line:

Quote:

FIX.BAT mingw
MINGW32-MAKE.EXE
MINGW32-MAKE.EXE DEBUGMODE=1
MINGW32-MAKE.EXE install
MINGW32-MAKE.EXE install DEBUGMODE=1 "

The Fix.bat works, but then, the error is

Quote:

makefile.all:248: *** recipe commences before first target. stop.

So i searched on this forum, and i found this topic:
http://www.allegro.cc/forums/thread/605079

In wich i saw that solution :
http://www.allegro.cc/forums/thread/600130/809982#target

I uninstalled CodeBlock, Mingw, Allegro, did it step by step carefully, the problem remains, i did it again reading all the topic, redoing a few times, but the error still remains.

I think my PATH is good. I tried a few directories to install mingw and allegro.
The mingw32-make.exe exist in the bin directory of MinGW (the same that CodeBlock, that's what is said in the solution topic).

The problem seems to be with MinGW (just in my opinion), but i really don't see how to fix it.

I really hope you can help me, i need allegro for a university project.
Thanks in advance

PS : I'm sorry for my english but it's not my first language =P

Matthew Leverton
Supreme Loser
January 1999
avatar

A few people have complained about that error message, but I've never seen anybody reply with a resolution other than to download the binaries or try version 4.4.

You can get a binary from here.

I would guess that your version of mingw32-make is broken or not compatible with the 4.2 makefiles.

dfighter
Member #12,495
January 2011

I all uninstalled, re-followed the first steps i send (on wiki allegro), taking the binaries you send (i just unzipped it in an "allegro" directory at the root, is that ok? ??? ) but the error is now
>mingw32-make: ***No target specified and no makefile found. stop

Failed with the binaries? ???

edit : i took a 5.1.3 version of MinGW

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

dfighter said:

Failed with the binaries?

Once you have the binaries, you no longer need to build Allegro with mingw32-make, it's been done for you.

dfighter said:

edit : i took a 5.1.3 version of MinGW

Which version of Allegro do you want to work with? Allegro 4 or Allegro 5?

dfighter said:

i just unzipped it in an "allegro" directory at the root, is that ok?

It is if you set the compiler and linker search directories in Code::Blocks, either for your project, or the global search directories.

Generally though, you will want to copy allegro.h and the include/allegro folder to your <MINGW_DIR>/include folder. After that, copy the *.a files to your <MINGW_DIR>/lib folder, and copy the *.dll files to your <WINDOWS>/System32 folder or include them with your completed project.

Edit :
Once installed, your mingw directory will look like this :

MINGW_DIR
   include
      allegro
      allegro.h
   lib
      *.a

WINDOWS
   System32
      *.dll

Matthew Leverton
Supreme Loser
January 1999
avatar

I wouldn't copy Allegro DLLs around like that. They aren't necessarily compatible with each other. The Allegro DLL should just go in with the same folder as your program.

You can safely put them in your MINGW_DIR/bin folder and make sure it's in the PATH when running your program during development.

Evert
Member #794
November 2000
avatar

So, did anyone ever look at line 248 of makefile.all?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Evert
Member #794
November 2000
avatar

We don't know which version of Allegro he used.

I had assumed that "allegro 4.2.2" in the thread title referred to the version number he was using.

dfighter
Member #12,495
January 2011

Hello,

Thank you for your answers.

I think I found a part of the problem. I downloaded an older version of MinGW and re-try the first instructions i followed ( http://wiki.allegro.cc/index.php?title=Code::Blocks )
The compilation of allegro seems to work, but when i launch a program, CodeBlock doesn't find allegro.h. All right, I copy all the .h files of allegro in the "include" directory of MinGW.

But Codeblock doesn't find the routines itself.

There is an "allegro" directory in the "include" directory of Allegro with a lot of .h . Should i use this?
May I copy it all in the "include" directory of MinGW?

[ I mean : C: / Allegro / include / allegro +.h files (those i copied) / .h files + other directories ]

It doesn't work yet, but I think this problem is easier than the previous though... x)

edit : Maybe problems with .a files too, because there is no .a in C:\allegro\lib\mingw32....

Edit 2 : I took a look to the result of the compilation of allegro, it seems there is errors, finally...

So, should I install directly binnary files? If yes, which one, in which directory?

I really don't understand.....

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Evert said:

I had assumed that "allegro 4.2.2" in the thread title referred to the version number he was using.

I didn't notice that for some reason or other. Whoops.

Line 248 of makefile.all :

makefile.all#SelectExpand
235# -------- rules for deleting the generated files -------- 236 237clean: 238ifdef UNIX_TOOLS 239 -rm $(RM_OPTS) $(OBJ_CLEAN_FILES) 240 -rm $(RM_OPTS) $(OTHER_CLEAN_FILES) 241else 242 define RM_CLEAN 243 $(foreach file, $(wildcard $(OBJ_CLEAN_FILES)), -del $(subst /,\,$(file)) 244 ) 245 $(foreach file, $(wildcard $(OTHER_CLEAN_FILES)), -del $(subst /,\,$(file)) 246 ) 247 endef 248 -$(RM_CLEAN) 249endif

‘recipe commences before first target. Stop.’
‘missing rule before recipe. Stop.’
This means the first thing in the makefile seems to be part of a recipe: it begins with a recipe prefix character and doesn't appear to be a legal make directive (such as a variable assignment). Recipes must always be associated with a target.

The second form is generated if the line has a semicolon as the first non-whitespace character; make interprets this to mean you left out the "target: prerequisite" section of a rule. See Rule Syntax.

I'm not really a makefile expert. I don't know what is wrong with it. Maybe someone else knows why make doesn't think -$(RM_CLEAN) is a legal directive.

dfighter said:

The compilation of allegro seems to work, but when i launch a program, CodeBlock doesn't find allegro.h. All right, I copy all the .h files of allegro in the "include" directory of MinGW.

But Codeblock doesn't find the routines itself.

There is an "allegro" directory in the "include" directory of Allegro with a lot of .h . Should i use this?
May I copy it all in the "include" directory of MinGW?

The make install command takes care of copying the files for you.

dfighter said:

So, should I install directly binnary files? If yes, which one, in which directory?

If you're still getting errors compiling Allegro, yes I would recommend using a binary package. To see where to put the respective files, see my earlier post.

Evert
Member #794
November 2000
avatar

I would start by printing the value of $RM_CLEAN, followed by moving its definition outside of the target.

dfighter
Member #12,495
January 2011

Hi,

Thank you for spending time to help me!

I downloaded a binary at this address : http://www.allegro.cc/files/?v=4.2

I took the "Allegro library pre-built for MinGW" (v 4.2.3)
I extract it in an allegro directory at the root, and then i copied each files in the directory of MinGW.
I mean, I copied the files of the "lib" directory of allegro in the "lib" directory of MinGW, and so on...
I did it for all the files, that is to say include, lib and bin...

I suppose I am wrong because it doesn't work either, but I don't understand why ^^"

I didn't find any "make install" command ???

torhu
Member #2,727
September 2002
avatar

Sounds about right, what error messages do you get?

dfighter
Member #12,495
January 2011

Hi,

The program can find the allegro.h file, but can't run the routines, here is a screen :

http://img513.imageshack.us/i/allegerr.jpg

Errors mean "reference/address (?) undefined to "install_keyboard" (for example)
So, CodeBlock don't reconize the routines I guess, or don't find them...

torhu
Member #2,727
September 2002
avatar

You have to tell it to link with the Allegro library, probably liballeg.a or something.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

You can find the linker options in Code Blocks by selecting 'Project -> Build Options'. Then select the release version of your project in the top left and click on linker settings. Under 'other linker options' add -lalleg. Likewise, for the debug version of your project, add -lalld to other linker options.

You can also change your global settings by going to the menu 'Settings -> Compiler and debugger' and changing the link options there.

dfighter
Member #12,495
January 2011

It works!! Thank you everyone, really, I would have not did it without you, thank you very much!

Go to: