|
This thread is locked; no one can reply to it. |
1
2
|
defeated by a simple install |
mr mentor
Member #6,042
July 2005
|
I just cannot get allegro to compile any code, summary follows Suse linux version 9.1 on an Amd 2ghz machine, 512mb ram, Nvidia propriatery video driver, soundblaster pci128 soundcard, realtek network card. in YOU I selected allegro for install, then added the line... #include "allegro.h" int main(void) return 0; this is a C project (terminal only), I also tried the following (from the book Game programming all in one second edition) #include "allegro.h" int main(void) return 0; in the first case I get the messages cd "/home/mentor/textslots/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k *cd "/home/mentor/textslots/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k if I replace the main(void) with main() I get the same error, the default form has a header that reads... #ifdef HAVE_CONFIG_H #include <stdio.h> if I modify that to read #ifdef HAVE_CONFIG_H #include "allegro.h" int main(int argc, char *argv[]) return EXIT_SUCCESS; I get the same error, just exactly what are the correct settings for Kdevelop? as far as I can tell I have made the correct associations for the linker, so why does it not find the allegro libs, I did also try compiling the libs myself from scratch after uninstalling the YAST installed ones, they configure and make with no errors, I used the commands ./configure the result showed no errors for each step, I then made the same line for the linker in a new project (eg:-L/usr/local/lib -L/usr/X11R6/lib -lalleg -lpthread -lXxf86dga -lXxf86vm -ldl), but the program will still not compile and I get the same errors, I have spent over a week pouring over the net and trying everything I can think of, it doesn`t help since I am only a Linux convert for six months and have not done any programming in that time, I thought using Kdevelop would be easy but it seems to be fighting me all the way . I did find a wiki that was talking about something that seemed pertinent, but I could not make head nor tail of it and it mentioned folders that are not present in my install, so I am not sure if that even applies to this problem, I have tried installing three other different flavours of Linux (Suse 9.2, Red Hat Fedora core 2 and Mandrake) but I get the same results in all those so it must be something I am doing inside the Kdevelop settings that is wrong, but what?, any help appreciated and seriously needed...before I run out of hair to rip out, cheers... Mentor. |
ReyBrujo
Moderator
January 2001
|
After you have installed Allegro (with make install), there should be an allegro-config script. When compiling Allegro programs, just use gcc program.c -o program `allegro-config --libs`. The allegro-config script will return the libraries you need in the correct order. -- |
Elias
Member #358
May 2000
|
[edit: beatan] -- |
GullRaDriel
Member #3,861
September 2003
|
The powerful whole `allegro-config --libs` answer, like the "these are backticks" one. Knees in front of allegro the supreme one ! OK, i'm going out ... "Code is like shit - it only smells if it is not yours" |
mr mentor
Member #6,042
July 2005
|
allow me to demonstrate my ignorance QUOTE:just use gcc program.c -o program `allegro-config --libs` eh?, where? from the commandline? (defeats the point of using an ide surely) or do I place it in compiler/project options/c/compiler command, I tried that and got the following error... *cd "/home/mentor/textslots/debug" && LDFLAGS="-L/usr/local/lib -L/usr/X11R6/lib -lalleg -lpthread -lXxf86dga -lXxf86vm -ldl" CXX= CFLAGS="-O0 -g3" CC=gcc textslots.c -o program `allegro-config --libs` "/home/mentor/textslots/configure" --enable-debug=full my exact line was gcc textslots.c -o textslots `allegro-config --libs` in the c compiler command line, of course I may just be being dumb, it`s a lot different from Windows apps where things just work when you install the SDK (how come there isn`t an option for Allegro templates under kdevelop anyway?) Mentor. (hair count down to <500) |
miran
Member #2,407
June 2002
|
Quote: eh?, where? from the commandline? (defeats the point of using an ide surely) or do I place it in compiler/project options/c/compiler command, I tried that and got the following error... Put `allegro-config --libs` where you put -lalleg. That is replace -lalleg with `allegro-config --libs`. The thing is that -lalleg works on DOS and Windows, but not in Linux! It's in the F. Manual. -- |
ReyBrujo
Moderator
January 2001
|
Try that out in the command line to check Allegro is installed correctly first. If it works, there is a place for kdevelop to set linker flags. Quote: *cd "/home/mentor/textslots/debug" && LDFLAGS="-L/usr/local/lib -L/usr/X11R6/lib -lalleg -lpthread -lXxf86dga -lXxf86vm -ldl" CXX= CFLAGS="-O0 -g3" CC=gcc textslots.c -o program `allegro-config --libs` "/home/mentor/textslots/configure" --enable-debug=full Hmm... why it moves first to the debug directory and tries to compile from there, when the source file is in the previous directory? I have never used kdevelop (good olde Vim and command line). -- |
mr mentor
Member #6,042
July 2005
|
I'm dumb! -lalleg works on DOS and Windows, but not in Linux! It's in the F. Manual. umm! what manual?, in the book I am working from this is what they tell you to enter for Kdevelop, and as far as know there isn`t a Windows version of Kdevelop (heaven forbid), nope, just checked and thats what the book says, nobody seems to have found this problem over at the authors site either, anyway, I added it to the list of flags as suggested and it said rerun configure for debug now? I said yes and then got the following error messages *cd "/home/mentor/textslots/debug" && LDFLAGS="-L/usr/local/lib -L/usr/X11R6/lib 'allegro-config --libs' -lpthread -lXxf86dga -lXxf86vm -ldl" CXX= CFLAGS="-O0 -g3" "/home/mentor/textslots/configure" --enable-debug=full so something changed but it still will not work maybe I should take up knitting (don`t even think of saying it...I know what you just thought:P ) Mentor |
ReyBrujo
Moderator
January 2001
|
Ugh... I must admit that the book (if we are talking about the same one) brings a good amount of visitors, even if bad written Hmm... the compiler seems to be broken...? -- |
mr mentor
Member #6,042
July 2005
|
well...I did think of that, but why does allegro compile ok? (no errors), is the c and c++ compiler two separate programs?, or is c just c++ with the ++ part turned off by flags so to speak? (from the message it looks like the c compiler is a separate thing, should i reinstall the compiler? Mentor. |
ReyBrujo
Moderator
January 2001
|
Write a small Hello World program, and compile it without passing an output argument (that is, like gcc hello.c and see if it creates a standard a.out executable. -- |
Evert
Member #794
November 2000
|
Quote: 'allegro-config --libs' `allegro-config --libs`. Use backticks `, not quotes '. Quote: umm! what manual?, Allegro's manual. Quote: in the book I am working from this is what they tell you to enter for Kdevelop, and as far as know there isn`t a Windows version of Kdevelop (heaven forbid), nope, just checked and thats what the book says,
It's wrong then. Or at least, it is incomplete. Quote: nobody seems to have found this problem over at the authors site either Don't get me started on problems that have been found in that book and pointed out. |
Thomas Fjellstrom
Member #476
June 2000
|
For using kdevelop with Allegro, you might want to take a look at this. -- |
mr mentor
Member #6,042
July 2005
|
sorry about the delay...been for my tea "hello world" works (the default one that KDevelop puts up), it`s when I try to include the allegro library that the thing fails to compile, the default code includes three libraries with no problem, either I have the IDE set up wrong or allegro will not install correctly, but I have spent a fair amount of time installing three versions of linux and configuring for them with the same result, so I guess it`s the ide or the configuration thats the problem (there are a couple of warnings about underquoted definitions during the compile for the default hello world, but they are not important afaik) that twiki site is what i was on about, but where they mention problems towards the end with unfound files...eg well...my directory tree only goes as far as usr/local/share, there is no /aclocal/allegro.m4 plea for understanding....remember I am an x winderz user all these config files with coded names and cryptic commands to run em, and pipes and scripts and .sh stuff sends me dizzy at times, pity they didn`t use something like the Amiga configuration system, I actualy managed to understand that;D Mentor. oops missed Everts post, sorry!, I actualy had to switch to superuser and then do as you suggested, since as a normal user the command did nothing, the reply I got was -L/usr/lib -L/usr/X11R6/lib -Wl,-export-dynamic -lalleg-4.1.9 -lalleg_unsharable so I am going to poke that into the linker flags section and see what happens, back in a tick.... tick argh!! (hair count now at 250 and falling) *checking for C compiler default output file name... should I remove the compilers and re-install?, is their anything else that would need to be removed at the same time?, or do you want to see the config log?. |
ReyBrujo
Moderator
January 2001
|
Print the contents of config.log here, in a code box (surround your code with <code> and </code>.
-- |
mr mentor
Member #6,042
July 2005
|
here you go, most of it looks like a screen crash on a speccy??? Mentor. |
ReyBrujo
Moderator
January 2001
|
Quote:
configure:2256: gcc -v </dev/null >&5 That is the problem. The `allegro-config --libs` is messing in your configure script. Hmm... try adding -DALLEGRO_NO_MAGIC_MAIN to your linker options. -- |
mr mentor
Member #6,042
July 2005
|
that just gives me the same error, just to check, this is what i now have in the linker flags section -L/usr/lib -L/usr/X11R6/lib -Wl,-export-dynamic -lalleg-4.1.9 -lalleg_unsharable and this is the error again configure: error: C compiler cannot create executables is that right?, thanks for your time and trouble btw, I have already spent a week on this, surrender is not an option. Mentor. |
CGamesPlay
Member #2,559
July 2002
|
Hi! I wrote that Allegro with autoconf article, so I might be able to help you I don't know what you guys have already done, but if you're passing those LDFLAGS to configure, you've buggered something up. If the following doens't help you, please start a new project with a clean slate. You do NOT need to modify any of the CFLAGS, CXXFLAGS, or LDFLAGS or anything passed to configure from kdevelop. If you do, you are doing something wrong. When you run make install, you have no /usr/local/share/aclocal directory? Do you have a /usr/share/aclocal/allegro.m4 file? If not, I suggest you copy the aclocal.m4 from allegro into your project (I believe you can overwrite you aclocal.m4, if not you can always regenerate it by running aclocal). -- Ryan Patterson - <http://cgamesplay.com/> |
mr mentor
Member #6,042
July 2005
|
hi..back again, (been sleeping this time...oh the frailty of man). well..thank you for that advice, I removed all the flags from the linker and away it went, no errors this time (just the config part that is), I am getting a bit confused here though, the twiki says you need a file in /usr/local/share/aclocal, but you say it`s also in usr/share/aclocal, well...it aint anyway, I did a search and I have four aclocal.m4 files, one in the allegro folder and the other three are in projects I made while trying different things to get it going, including the one I am currently working on, I deleted and replaced the file with a copy from the allegro folder, the system tells me the one from the allegro folder is 15.7kb, the one already in the program folder is 237.2kb, anyway, I overwrote the file and tried again, this is what I got. *cd "/home/mentor/textslots/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k and this is the code I am using at the moment (just in case I made some weird error):-X #include "allegro.h" int main() return 0; which (afaik) should just include allegro and initialise it before exiting, a perfectly legal program, yes?, anyway, the config now compiles, its just the allegro include that isn`t working yet, unfortunatly any experience on what will or will not work on different distros has been wasted since I was trying to put those linker switches into the IDE on the other installs, so no wonder I wasn`t getting very far <hair count now at 125 and falling>, I await further suggestions all agog Mentor strange...just noticed my poster name is mr mentor, that isn`t what I put in when I registered??? (Ment0r) |
CGamesPlay
Member #2,559
July 2002
|
There should be allegro.m4 in /usr/share/aclocal. If there isn't, and you installed allegro from sources, it should be in /usr/local/share/aclocal. If there isn't an allegro.m4 in /usr/share/aclocal, put one there. It will simplify this process. Then, please put into the forums your configure.in file, Makefile.am, and src/Makefile.am. Quote: *cd "/home/mentor/textslots/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k KDevelop has some odd bugs where it guesses the name of the source file incorrectly in the "Short Compiler Output" option. Right click in this window and select "Full Compiler Output", then paste the build log. Quote: strange...just noticed my poster name is mr mentor, that isn`t what I put in when I registered??? (Ment0r) my profile (link at top right of this page)->Website Customization->Privacy Settings->Name Display. [edit] -- Ryan Patterson - <http://cgamesplay.com/> |
mr mentor
Member #6,042
July 2005
|
Phew! worra shopping list! ok! heres the full debug messages cd "/home/mentor/textslots/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k the allegro install I currently have was installed from the packed file off the books cd (allegro 4.01) due to the books author saying that later versions would probably not be compatable, I checked the install by doing make clean the last two are not realy needed to get things going afaik but I included em since I want the manuals and co if...errr...when I get it going, the "make install-info" stage threw this error echo ought to run makeinfo --no-split -o docs/info/allegro.info docs/texi/allegro.texi I don`t think this matters but mention it for completeness, as for the rest of the shopping list, heres the configure.in file AC_INIT(configure.in) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(textslots, 0.1) AC_LANG_C AC_PROG_CC AM_PROG_LIBTOOL AC_OUTPUT(Makefile src/Makefile)
makefile.am # not a GNU package. You can remove this line, if # have all needed files, that a GNU package needs AUTOMAKE_OPTIONS = foreign 1.4 SUBDIRS = src and finaly src/makefile.am bin_PROGRAMS = textslots textslots_SOURCES = textslots.c # set the include path found by configure INCLUDES= $(all_includes) # the library search path. textslots_LDFLAGS = $(all_libraries) hope thats all you wanted, time to hop back and check if I need to edit:) Mentor. |
Evert
Member #794
November 2000
|
Quote: There should be allegro.m4 in /usr/share/aclocal. Not if he's using 4.0 Quote: the allegro install I currently have was installed from the packed file off the books cd (allegro 4.01) due to the books author saying that later versions would probably not be compatable
Nonsense. I've seen him claim that code that compiled fine wouldn't work with newer versions of Allegro and he's never once said why (despite me asking him to support his claims). It just isn't true. |
mr mentor
Member #6,042
July 2005
|
ok, it seems this book may not be as helpful as I expected (cost £36 ):o too), but I don`t see what harm installing the latest library would do anyway since I mostly just need pointers, I can normaly work out things for myself (apart from IDE/Compiler problems that is ) I will download and install the most recent allegro and continue on this thread from there, if anyone has a good reason why I shouldn`t then I can remove it and re-install the olde version anyway. Mentor. |
CGamesPlay
Member #2,559
July 2002
|
Yep. Evert's right (of course ). The reason you don't have allegro.m4 is because you haven't upgraded to 4.2.0 beta 4 You really should. We've spoken to the author of that book, and to my understanding he conceded that this information may not have been true (it's not true, but he conceded that it may not be true ). [edit] Quote: ok, it seems this book may not be as helpful as I expected (cost £36 ):o too), but I don`t see what harm installing the latest library would do anyway since I mostly just need pointers Well, the book's information is mostly valid. The author simply didn't have luck compiling the newer version of Allegro. All the information in the book is still valid, with the exception of the functions that are now deprecated (motly textprintf and like functions). Those functions will still work, but you'll get a message saying "these functions are deprecated". -- Ryan Patterson - <http://cgamesplay.com/> |
|
1
2
|