From: "Kalum Somaratna aka Grendel" To: djgpp AT delorie DOT com Date: Wed, 17 Nov 1999 18:27:09 +0600 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Problem with allegro CC: In-reply-to: <199911162248.RAA18691@vesuve.globetrotter.net> X-mailer: Pegasus Mail for Win32 (v3.12) Message-ID: <94287796401@out.newmail.net> Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 8 Jan 00, at 7:45, denis jobin wrote: > When I compile something that use function from allegro.h, (like some of > the examples included in the allegro package) it`s work well. But when I > come to build it, I get a lot of "undefined reference to..." error message. > {eg: (10) undefined reference to allegro_init()} Hi Denis, First please make sure that you include the allegro header file in you program using #include . And when you compile a program which uses allegro functions please make sure that you link in the allegro library by adding the "- lalleg" (without the quotes) switch. And example compilation will be "gcc game.c -o game.exe -lalleg" The -lalleg instructs the linker to link with the allegro library otherwise the linker will report undefined references. So I think your program should compile OK after adding the -lalleg switch. > The reason why I think it occur is that when I builded allegro, I used "make all" instead of "make" because I didn`t had > the .exe required to use "make". To compile allegro you need MAKE.EXE which proceses makefiles. You get it by downloading and unzipping mak377b.zip to the DJGPP directory. AFAIK there is no EXE required to use MAKE. So I am a bit confused here. So if when you went to the allegro directory and typed "make all" and you saw allegro being built then you have MAKE.EXE installed. If allegro is built without errors then it will copy allegro.h to your "djgpp\include" directory and liballeg.a(the allegro library) to the "djgpp\lib" directory. You can check if these files are there to see whether allegro is installed properly. Hope This Helps Kalum