Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » defeated by a simple install

This thread is locked; no one can reply to it. rss feed Print
 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.
the system is fully updated and on the latest kernel, I can compile the kernel or allegro with no errors, I have tried the following.

in YOU I selected allegro for install, then added the line...
-L/usr/local/lib -L/usr/X11R6/lib -lalleg -lpthread -lXxf86dga -lXxf86vm -ldl
to the linker flags section of the projects project options/configure options/linker flags, I then attempted to compile the following code.

#include "allegro.h"

int main(void)
{
allegro_init();

return 0;
}
END_OF_MAIN();

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)
{
char version[80];
allegro_init();
sprintf(version, "Allegro library version = %$", allegro_id);
allegro_message(version);

return 0;
}
END_OF_MAIN();

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
*linking textslots (libtool)
*linking textslots (gcc)
*../sysdeps/i386/elf/start.S:98: undefined reference to `main'
*/home/mentor/textslots/src/textslots.c:26: undefined reference to `install_allegro'
**** Exited with status: 2 ***

and likewise for the second, this would lead me to think that the flags for the linker are wrong, but I have checked them repeatedly and they are exactley as printed in "Game programming all in one second edition", if I leave out the line with allegro_init then I get the error

*cd "/home/mentor/textslots/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
*compiling fi (gcc)
*linking textslots (libtool)
*linking textslots (gcc)
*../sysdeps/i386/elf/start.S:98: undefined reference to `main'
**** Exited with status: 2 ***

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 <config.h>
#endif

#include <stdio.h>
#include <stdlib.h>

if I modify that to read

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "allegro.h"

int main(int argc, char *argv[])
{
allegro_init();

return EXIT_SUCCESS;
}
END_OF_MAIN();

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
make all
su -c "make install"
su -c "make install-man"
su -c "make install-info"

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
avatar

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.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Elias
Member #358
May 2000

[edit: beatan]

--
"Either help out or stop whining" - Evert

GullRaDriel
Member #3,861
September 2003
avatar

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"
Allegro Wiki, full of examples and articles !!

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
*/bin/sh: line 1: textslots.c: command not found
**** Exited with status: 127 ***

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.

--
sig used to be here

ReyBrujo
Moderator
January 2001
avatar

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
*/bin/sh: line 1: textslots.c: command not found

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).

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

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
*installing -c
*checking whether build environment is sane... yes
*checking for gawk... gawk
*checking whether make sets $(MAKE)... yes
*checking for gcc... gcc
*checking for C compiler default output file name...
*configure: error: C compiler cannot create executables
*See `config.log' for more details.
**** Exited with status: 77 ***

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
avatar

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

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

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
avatar

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.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Evert
Member #794
November 2000
avatar

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.
KDevelop is a problem because you can't put `allegro-config --libs` somewhere; you need to list the libraries that need to be linked in explicitly. To find out which, run allegro-config --libs from a terminal and paste the content in the list of linker options.

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
avatar

For using kdevelop with Allegro, you might want to take a look at this.

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

mr mentor
Member #6,042
July 2005

sorry about the delay...been for my tea ;D

"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
aclocal does not seem to search in usr/local/share/aclocal for m4 files. This means that if you built allegro from sources yourself, you probably will have to move the file `/usr/local/share/aclocal/allegro.m4` to `/usr/share/aclocal`.

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...
*configure: error: C compiler cannot create executables
*See `config.log' for more details.
**** Exited with status: 77 ***

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
avatar

Print the contents of config.log here, in a code box (surround your code with <code>
and </code>.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

mr mentor
Member #6,042
July 2005

1This file contains any messages produced by compilers while
2running configure, to aid debugging if configure makes a mistake.
3 
4It was created by configure, which was
5generated by GNU Autoconf 2.59. Invocation command line was
6 
7 $ /home/mentor/textslots/configure --enable-debug=full
8 
9## --------- ##
10## Platform. ##
11## --------- ##
12 
13hostname = linux
14uname -m = i686
15uname -r = 2.6.5-7.155.29-default
16uname -s = Linux
17uname -v = #1 Thu Jun 2 12:07:05 UTC 2005
18 
19/usr/bin/uname -p = unknown
20/bin/uname -X = unknown
21 
22/bin/arch = i686
23/usr/bin/arch -k = unknown
24/usr/convex/getsysinfo = unknown
25hostinfo = unknown
26/bin/machine = unknown
27/usr/bin/oslevel = unknown
28/bin/universe = unknown
29 
30PATH: /home/mentor/bin
31PATH: /usr/local/bin
32PATH: /usr/bin
33PATH: /usr/X11R6/bin
34PATH: /bin
35PATH: /usr/games
36PATH: /opt/gnome/bin
37PATH: /opt/kde3/bin
38PATH: /usr/lib/java/bin
39 
40 
41## ----------- ##
42## Core tests. ##
43## ----------- ##
44 
45configure:1539: checking for a BSD-compatible install
46configure:1594: result: /usr/bin/install -c
47configure:1605: checking whether build environment is sane
48configure:1648: result: yes
49configure:1705: checking for gawk
50configure:1721: found /usr/bin/gawk
51configure:1731: result: gawk
52configure:1741: checking whether make sets $(MAKE)
53configure:1761: result: yes
54configure:1978: checking for gcc
55configure:1994: found /usr/local/bin/gcc
56configure:2004: result: gcc
57configure:2248: checking for C compiler version
58configure:2251: gcc --version </dev/null >&5
59gcc (GCC) 3.3.3 (SuSE Linux)
60Copyright (C) 2003 Free Software Foundation, Inc.
61This is free software; see the source for copying conditions. There is NO
62warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
63 
64configure:2254: $? = 0
65configure:2256: gcc -v </dev/null >&5
66Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.3/specs
67Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
68Thread model: posix
69gcc version 3.3.3 (SuSE Linux)
70configure:2259: $? = 0
71configure:2261: gcc -V </dev/null >&5
72gcc: `-V' option must have argument
73configure:2264: $? = 1
74configure:2287: checking for C compiler default output file name
75configure:2290: gcc -O0 -g3 -L/usr/lib -L/usr/X11R6/lib -Wl,-export-dynamic -lalleg-4.1.9 -lalleg_unsharable
76 conftest.c >&5
77/usr/lib/liballeg-4.1.9.so: undefined reference to `_mangled_main_address'
78collect2: ld returned 1 exit status
79configure:2293: $? = 1
80configure: failed program was:
81| /* confdefs.h. */
82|
83| #define PACKAGE_NAME ""
84| #define PACKAGE_TARNAME ""
85| #define PACKAGE_VERSION ""
86| #define PACKAGE_STRING ""
87| #define PACKAGE_BUGREPORT ""
88| #define PACKAGE "textslots"
89| #define VERSION "0.1"
90| /* end confdefs.h. */
91|
92| int
93| main ()
94| {
95|
96| ;
97| return 0;
98| }
99configure:2332: error: C compiler cannot create executables
100See `config.log' for more details.
101
102## ---------------- ##
103## Cache variables. ##
104## ---------------- ##
105
106ac_cv_env_CC_set=
107ac_cv_env_CC_value=
108ac_cv_env_CFLAGS_set=set
109ac_cv_env_CFLAGS_value='-O0 -g3'
110ac_cv_env_CPPFLAGS_set=
111ac_cv_env_CPPFLAGS_value=
112ac_cv_env_CPP_set=
113ac_cv_env_CPP_value=
114ac_cv_env_CXXCPP_set=
115ac_cv_env_CXXCPP_value=
116ac_cv_env_CXXFLAGS_set=
117ac_cv_env_CXXFLAGS_value=
118ac_cv_env_CXX_set=
119ac_cv_env_CXX_value=
120ac_cv_env_F77_set=
121ac_cv_env_F77_value=
122ac_cv_env_FFLAGS_set=
123ac_cv_env_FFLAGS_value=
124ac_cv_env_LDFLAGS_set=set
125ac_cv_env_LDFLAGS_value='-L/usr/lib -L/usr/X11R6/lib -Wl,-export-dynamic -lalleg-4.1.9 -lalleg_unsharable
126ac_cv_env_build_alias_set=
127ac_cv_env_build_alias_value=
128ac_cv_env_host_alias_set=
129ac_cv_env_host_alias_value=
130ac_cv_env_target_alias_set=
131ac_cv_env_target_alias_value=
132ac_cv_path_install='/usr/bin/install -c'
133ac_cv_prog_AWK=gawk
134ac_cv_prog_ac_ct_CC=gcc
135ac_cv_prog_make_make_set=yes
136 
137## ----------------- ##
138## Output variables. ##
139## ----------------- ##
140 
141'
142ACLOCAL='${SHELL} /home/mentor/textslots/missing --run aclocal-1.8'
143AMDEPBACKSLASH=''
144AMDEP_FALSE=''
145AMDEP_TRUE=''
146AMTAR='${SHELL} /home/mentor/textslots/missing --run tar'
147AR=''
148AUTOCONF='${SHELL} /home/mentor/textslots/missing --run autoconf'
149AUTOHEADER='${SHELL} /home/mentor/textslots/missing --run autoheader'
150AUTOMAKE='${SHELL} /home/mentor/textslots/missing --run automake-1.8'
151AWK='gawk'
152CC='gcc'
153CCDEPMODE=''
154CFLAGS='-O0 -g3'
155CPP=''
156CPPFLAGS=''
157CXX=''
158CXXCPP=''
159CXXDEPMODE=''
160CXXFLAGS=''
161CYGPATH_W='echo'
162DEFS=''
163DEPDIR=''
164ECHO='echo'
165ECHO_C=''
166ECHO_N='-n'
167ECHO_T=''
168EGREP=''
169EXEEXT=''
170F77=''
171FFLAGS=''
172INSTALL_DATA='${INSTALL} -m 644'
173INSTALL_PROGRAM='${INSTALL}'
174INSTALL_SCRIPT='${INSTALL}'
175INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
176LDFLAGS='-L/usr/lib -L/usr/X11R6/lib -Wl,-export-dynamic -lalleg-4.1.9 -lalleg_unsharable
177LIBOBJS=''
178LIBS=''
179LIBTOOL=''
180LN_S=''
181LTLIBOBJS=''
182MAKEINFO='${SHELL} /home/mentor/textslots/missing --run makeinfo'
183OBJEXT=''
184PACKAGE='textslots'
185PACKAGE_BUGREPORT=''
186PACKAGE_NAME=''
187PACKAGE_STRING=''
188PACKAGE_TARNAME=''
189PACKAGE_VERSION=''
190PATH_SEPARATOR=':'
191RANLIB=''
192SET_MAKE=''
193SHELL='/bin/sh'
194STRIP=''
195VERSION='0.1'
196ac_ct_AR=''
197ac_ct_CC='gcc'
198ac_ct_CXX=''
199ac_ct_F77=''
200ac_ct_RANLIB=''
201ac_ct_STRIP=''
202am__fastdepCC_FALSE=''
203am__fastdepCC_TRUE=''
204am__fastdepCXX_FALSE=''
205am__fastdepCXX_TRUE=''
206am__include=''
207am__leading_dot='.'
208am__quote=''
209bindir='${exec_prefix}/bin'
210build=''
211build_alias=''
212build_cpu=''
213build_os=''
214build_vendor=''
215datadir='${prefix}/share'
216exec_prefix='NONE'
217host=''
218host_alias=''
219host_cpu=''
220host_os=''
221host_vendor=''
222includedir='${prefix}/include'
223infodir='${prefix}/info'
224install_sh='/home/mentor/textslots/install-sh'
225libdir='${exec_prefix}/lib'
226libexecdir='${exec_prefix}/libexec'
227localstatedir='${prefix}/var'
228mandir='${prefix}/man'
229mkdir_p='mkdir -p -- .'
230oldincludedir='/usr/include'
231prefix='NONE'
232program_transform_name='s,x,x,'
233sbindir='${exec_prefix}/sbin'
234sharedstatedir='${prefix}/com'
235sysconfdir='${prefix}/etc'
236target_alias=''
237 
238## ----------- ##
239## confdefs.h. ##
240## ----------- ##
241 
242#define PACKAGE "textslots"
243#define PACKAGE_BUGREPORT ""
244#define PACKAGE_NAME ""
245#define PACKAGE_STRING ""
246#define PACKAGE_TARNAME ""
247#define PACKAGE_VERSION ""
248#define VERSION "0.1"
249 
250configure: exit 77

here you go, most of it looks like a screen crash on a speccy???

Mentor.

ReyBrujo
Moderator
January 2001
avatar

Quote:

configure:2256: gcc -v </dev/null >&5
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.3/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada --disable-checking --libdir=/usr/lib --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.3 (SuSE Linux)
configure:2259: $? = 0
configure:2261: gcc -V </dev/null >&5
gcc: `-V' option must have argument
configure:2264: $? = 1
configure:2287: checking for C compiler default output file name
configure:2290: gcc -O0 -g3 -L/usr/lib -L/usr/X11R6/lib -Wl,-export-dynamic -lalleg-4.1.9 -lalleg_unsharable
conftest.c >&5
/usr/lib/liballeg-4.1.9.so: undefined reference to `_mangled_main_address'
collect2: ld returned 1 exit status
configure:2293: $? = 1
configure: failed program was:

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.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

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

and this is the error again

configure: error: C compiler cannot create executables
*See `config.log' for more details.
**** Exited with status: 77 ***

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
avatar

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).

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

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 :o

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
*compiling fi (gcc)
*linking textslots (libtool)
*linking textslots (gcc)
*../sysdeps/i386/elf/start.S:98: undefined reference to `main'
*/home/mentor/textslots/src/textslots.c:25: undefined reference to `install_allegro'
**** Exited with status: 2 ***

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()
{
allegro_init();

return 0;
}
END_OF_MAIN();

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 ;D

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
avatar

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
*compiling fi (gcc)
*linking textslots (libtool)
*linking textslots (gcc)
*../sysdeps/i386/elf/start.S:98: undefined reference to `main'
*/home/mentor/textslots/src/textslots.c:25: undefined reference to `install_allegro'
**** Exited with status: 2 ***

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]
Third spelling edit. I can't type, and I can't proofread :-X

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

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

mr mentor
Member #6,042
July 2005

Phew! worra shopping list! ;D

ok! heres the full debug messages

cd "/home/mentor/textslots/debug" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k
*gmake all-recursive
*Making all in src
*/bin/sh ../libtool --mode=link gcc -O0 -g3 -o textslots textslots.o
*gcc -O0 -g3 -o textslots textslots.o
*/usr/lib/gcc-lib/i586-suse-linux/3.3.3/../../../crt1.o(.text+0x18): In function `_start':
*../sysdeps/i386/elf/start.S:98: undefined reference to `main'
*textslots.o(.text+0x1d): In function `_mangled_main':
*/home/mentor/textslots/src/textslots.c:25: undefined reference to `install_allegro'
*collect2: ld returned 1 exit status
*gmake[2]: *** [textslots] Error 1
*gmake[2]: Target `all' not remade because of errors.
*gmake[1]: *** [all-recursive] Error 1
*gmake: *** [all] Error 2
**** Exited with status: 2 ***

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
./configure
make all
su -c "make install"
su -c "make install-man"
su -c "make install-info"

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
ought to run makeinfo --no-split -o docs/info/allegro.info docs/texi/allegro.texi
Installing Allegro info documentation...
/bin/sh ./misc/mkdirs.sh /usr/local/info
/usr/bin/install: cannot stat `docs/info/allegro.info': No such file or directory
make: *** [install-info] Error 1

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
avatar

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.
If you're compiling and installing your own version anyway, do yourself a favour and get 4.2 beta, or at least 4.0.3.

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 ;D)

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
avatar

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

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

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

 1   2 


Go to: