Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » installing allegro on Linux for KDevelop

This thread is locked; no one can reply to it. rss feed Print
 1   2 
installing allegro on Linux for KDevelop
some user
Member #5,969
June 2005

hello. :)
i am using knoppix 3.8.2 Live cd from the cdrom and KDevelop as a compiler and i would like to know how can i install Allegro to work with KDevelop as i did for windows and visual c.
what binary file do i need to download?
how do i install it?

Michael Faerber
Member #4,800
July 2004
avatar

To install, you can't use a binary for Linux. You'll have to install Allegro from source.

Download from http://prdownloads.sourceforge.net/alleg/allegro-4.2.0-beta4.tar.gz?download.

Unpack the archive, run ./configure, make and sudo make install, and the library is installed.

EDIT: Sorry, I overlooked that you used a Live CD! I don't know if it's possible to install Allegro on a Live CD, but I can suggest installing a good Linux on your disk.

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

some user
Member #5,969
June 2005

thank you for your reply, i downloaded the file, could you please explain step-by-step what do i do next?
maybe there is a way i can do it manually without using a script?

Michael Faerber
Member #4,800
July 2004
avatar

Using a script is probably manual enough.

I will try to explain the steps:

1) Let's pretend you have the file in your home directory, e.g. home/someuser.
2) Now open a konsole window (don't know where it is in the Knoppix menu, but should be in System or Administration or something. Just look for Konsole, Terminal or xterm and open one of those programs.
3) Now type "tar -xzf allegro*.tar.gz".
4) Now type "cd allegro*".
5) Now type "./configure", then "make", then "sudo make install".

Post here if you have any problems. You'll probably run into problems when you execute "sudo make install", just post here.

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

some user
Member #5,969
June 2005

thanks Michael Faerber!
i think it worked! :D
do you know how can i link it to KDevelop?

Michael Faerber
Member #4,800
July 2004
avatar

Are you sure it really worked? I would try to compile a test program:

#include <allegro.h>
int main()
{
   allegro_init();
   allegro_message("It has really worked!");
   return 0;
}
END_OF_MAIN()

Save this in your home directory as allegrotest.c and open konsole/terminal/xterm.
Execute following command: "gcc allegrotest.c `allegro-config --libs` -o allegrotest".
Notice: Those slashes around "allegro-config --libs" are special ones!
If that has worked, post here.

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

some user
Member #5,969
June 2005

the command:

Quote:

gcc allegrotest.c `allegro-config --libs` -o allegrotest

for the program:

#include <allegro.h>
int main()
{
   allegro_init();
   allegro_message("It has really worked!");
   return 0;
}
END_OF_MAIN()

shows on console the message:

Quote:

allegrotest.c:8:14: warning: no newline at end of file

Michael Faerber
Member #4,800
July 2004
avatar

Okay, then it should be installed! :D

In KDevelop, you'll have to find "Linker settings". This is probably the hard part (I've needed some time to find it). Then you'll have to insert `allegro-config --libs` there.

Make a test program for KDevelop too because there were some traps, I remember.

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

some user
Member #5,969
June 2005

like this?
http://img336.imageshack.us/img336/6864/linker1wm.png
Thanks to ImageShack for Free Image Hosting

Michael Faerber
Member #4,800
July 2004
avatar

No, there has to be one line with `allegro-config --libs`.

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

some user
Member #5,969
June 2005

i added it as one line, but kdevelop breaks it to two part. :-/

Michael Faerber
Member #4,800
July 2004
avatar

Damn! I'll have to go some time now, will report back later!

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

some user
Member #5,969
June 2005

okay, thanks! :)

Kitty Cat
Member #2,815
October 2002
avatar

Run allegro-config --libs on the command line. That'll give you a list of things to add to KDevelop's linker settings.

EDIT: Should probably do the same with allegro-config --cflags and the CFLAGS settings.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Michael Faerber
Member #4,800
July 2004
avatar

Hey, Kitty, when I was away, I thought about completely the same! ;D

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

some user
Member #5,969
June 2005

okay, i used the commands to get some strings and added them to Libraries and CFLAGS but when i try to compile the code above i get the error:

Quote:

cd '/home/knoppix/helloworld/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -k
make all-recursive
Making all in src
cd /home/knoppix/helloworld && /bin/sh /home/knoppix/helloworld/missing --run automake-1.7 --gnu src/Makefile
src/Makefile.am:10: linker flags such as `-Wl,--export-dynamic' belong in `helloworld_LDFLAGS
make[2]: *** [/home/knoppix/helloworld/src/Makefile.in] Error 1
make[2]: Failed to remake makefile `Makefile'.
make[2]: *** No rule to make target `-Wl,--export-dynamic', needed by `helloworld'.
make[2]: Target `all' not remade because of errors.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Exited with status: 2 ***

Michael Faerber
Member #4,800
July 2004
avatar

In this case, remove the CFLAGS and all flags except your libraries from KDevelop. It seems it doesn't like the -W1 stuff, and I've never had big problems without Allegro's CFLAGS.

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

some user
Member #5,969
June 2005

thanks! removing W1 stuff did the trick. ;D

CGamesPlay
Member #2,559
July 2002
avatar

Ah! No! I know KittyCat knows better than that! Read how to properly do it!

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Michael Faerber
Member #4,800
July 2004
avatar

Are you sure everybody is speaking German here?

Anyway, the article says that instead of writing "`allegro-config --libs`" you should just write "allegro-config --libs" in the linker settings.

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

Specter Phoenix
Member #1,425
July 2001
avatar

I love how forgetting to hit enter after your last line of code makes the warning no new line appear during compilation:). I do all my stuff by command line only under linux and I don't touch windows now. I haven't been under windows in about a month ever since I got my modem working under Linux. Oddly the modem won't let me surf the web under windows but connects to my ISP just fine. Anyways remember to get rid of the retarded newline warning just press enter after your last '}' of main().

Michael Faerber
Member #4,800
July 2004
avatar

I don't use an IDE too, I use vim for coding and some xterms for compiling. I have started loving my Xfce Desktop Pager, which makes me switch between my compilation, browsing and coding desktops.

I wouldn't use Windows anymore, if just James Bunting had released a Linux version of Meteor 2. :'(

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

Anyway, the article says that instead of writing "`allegro-config --libs`" you should just write "allegro-config --libs" in the linker settings.

No it doesn't.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

Michael Faerber
Member #4,800
July 2004
avatar

Quote:

Es sollte eigentlich genügen wenn Du die Ausgabe des Befehls allegro-config --libs in die Compileroptionen deines Projekts einträgst.

Translation:
It should be enough to fill in the output of the command allegro-config --libs to the compiler options of your project.

Okay, I said linker settings instead of compiler settings. :-X

--
"The basic of informatics is Microsoft Office." - An informatics teacher in our school
"Do you know Linux?" "Linux? Isn't that something for visually impaired people?"

CGamesPlay
Member #2,559
July 2002
avatar

I think that you are logged into google right now and your language is set to google.de or some such. Anyways... [url http://awiki.strangesoft.net/bin/view/Main/AllegroWithAutoconf] is the article I am referring to.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

 1   2 


Go to: