Hi,
I have been reading the site and the forums, but I still dont know how to compile allegro within kdevelop.
I have installed allegro, and example's from tutorials compile just fine (outside kdevelop with "$make".
Can someone write in short how to set kdevelop up? Or a link to a tutorial?
niels@niels-desktop:~/Programmeer/C++/allegro2$ make
make all-recursive
make[1]: Entering directory `/home/niels/Programmeer/C++/allegro2'
Making all in src
make[2]: Entering directory `/home/niels/Programmeer/C++/allegro2/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I.. @allegro_CFLAGS@ -g -O2 -MT allegro2.o -MD -MP -MF ".deps/allegro2.Tpo" -c -o allegro2.o allegro2.cpp; \
then mv -f ".deps/allegro2.Tpo" ".deps/allegro2.Po"; else rm -f ".deps/allegro2.Tpo"; exit 1; fi
g++: @allegro_CFLAGS@: No such file or directory
make[2]: *** [allegro2.o] Error 1
make[2]: Leaving directory `/home/niels/Programmeer/C++/allegro2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/niels/Programmeer/C++/allegro2'
make: *** [all] Error 2
niels@niels-desktop:~/Programmeer/C++/allegro2$
I followed everyting, but with the command make it just goes completely worng:-/
http://www.allegro.cc/forums/thread/513272
It used to work around a year ago, I'm not sure if it still does. IIRC iIt is based on the awiki article so it might not.
Can you post your src/Makefile.am, Makefile.am, and configure.in, please?
Project name: allegro2
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
configure.in:
AC_INIT(configure.in)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(allegro2, 0.1)
AC_LANG_CPLUSPLUS
AC_PROG_CXX
AM_PROG_LIBTOOL
AC_OUTPUT(Makefile src/Makefile)
AM_PATH_ALLEGRO([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
AM_PATH_ALLEGRO()
AM_PATH_ALLEGRO(4.1.0)
src/Makefile.am
bin_PROGRAMS = allegro2
allegro2_SOURCES = allegro2.cpp
set the include path found by configure
INCLUDES= $(all_includes)
the library search path.
allegro2_LDFLAGS = $(all_libraries)
allegro2_LDADD = $(allegro_LIBS)
AM_CFLAGS = $(allegro_CFLAGS)
AM_CXXFLAGS = $(allegro_CFLAGS)
AM_PATH_ALLEGRO([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
AM_PATH_ALLEGRO()
AM_PATH_ALLEGRO(4.1.0)
AC_OUTPUT(Makefile src/Makefile)
They had to be the other way around, now it seems to compile just fine 
Thanks for that tread you gave me, because there was someone with the same problem.
Please remove these lines:
AM_PATH_ALLEGRO([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
AM_PATH_ALLEGRO()
They were just an example 
At your option, you can leave AM_PATH_ALLEGRO() and instead remove AM_PATH_ALLEGRO(4.1.0).
They were just an example
Haha, I found it weird anyway::)
Now I have changed the code, but it doest compile, make doesnt do anything anymore, just:
make[2]: Nothing to be done for `all'.
my bad, made a few stupid mistakes, it works:P
That means it's already done. It only rebuilds it if you have changed the files
Yes, I was changing the wrong files:-/
Now it compiles fine, but when I run my program from the command line, it fails at this line:
blit(my_pic, screen, 0,0,0,0,480,360); //Draw the whole bitmap to the screen at (0,0)
niels@niels-desktop:~/Programmeer/C++/allegro2$ ./src/allegro2
Shutting down Allegro due to signal #11
Segmentation fault
I load my blit like this:
my_pic = load_bitmap("picture.bmp", NULL); // Load our picture
The strange thing is, that when I run my program in kdevelop with build->execute program or debug->start the program just works!
Problem is the programs have their working path's wront. Print out argv[0] from the main function and you'll see it is different.
One obvious solution would be to execute your program from the same directory as KDevelop.
Yeah, you need to do this:
niels@niels-desktop:~/Programmeer/C++/allegro2$ src/allegro2
niels@niels-desktop:~/Programmeer/C++/allegro2/src$ allegro2
Worked,
But wont other people have trouble with running my future games, because they are not running it from home/niels/Programmeer/C++/allegro2/src ?
Yes. The picture file needs to be in the same directory as the person running the program. In many cases, this is the same directory as the program. In others, this isn't, and you need to check in some other directory, for instance usr/share/games/allegro2.
Yay, you're great;D