build hello world fail

Asked by julien martigny on 2007-06-05

Hi, im a brand spanking newbie in programming. I just bought a book about programming in c++, installed kdevelop and build-essential package on kubuntu.

this is the error i get when trying to run the simple hello world program

cd '/home/julien/programation/hello' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -f Makefile.cvs && mkdir '/home/julien/programation/hello/debug' && cd '/home/julien/programation/hello/debug' && CXXFLAGS="-O0 -g3" "/home/julien/programation/hello/configure" --enable-debug=full && cd '/home/julien/programation/hello/debug/./src' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -k hello
make: aclocal: Command not found
make: *** [all] Error 127
*** Exited with status: 2 ***

please help me, im starting a course in programming soon and would like to have some basic before the first class

Question information

English Edit question
Ubuntu kdevelop Edit question
No assignee Edit question
Solved by:
julien martigny
Last query:
Last reply:
Christian Csar (cacsar) said : #1

aclocal is supposed to be a part of the automake package (according to, so the first thing would be to check that automake is installed. Bug #118413 is about kdevelop not claiming to require automake when it should, so installing automake ought to suffice.

However, if you are starting a programming course it is likely that they will wish for you to do make files for your self at some point, and this is a nice and handy way to ignore whatever problems kdevelop is giving you.
I have included a simple makefile below. # comments out a line, CC is a variable for the name of the complier, TARGETS lists the executables that I wish to make, here I have called it action. ACT is the variable I am using for the list of my object file, for you it is probably hello.o or something similar. CFLAGS gives the various options to the compiler, -std=C99 means that it is compiling using the 1999 version of C, which I believe is current. Note that when one changes the name of an executable in TARGETS it is also necessary to add of change it under the command, here action is below all. There are of course much better introductions to makefiles out there than this completely inadequate one.
CC = gcc
CFLAGS = -O1 -Wall -std=c99 -g -pedantic

#Object files
ACT = driver.o student.o symtab.o util.o heap.o flexbuf.o scholarship.o eligible.o action.o pool.o

TARGETS = action

all: $(TARGETS)

action: $(ACT)
        $(CC) -o $@ $(ACT)

        rm -f $(TARGETS) *.o
#Dependencies automatic

julien martigny (julienmn) said : #2

thank you very much for your quick answer CACLF,

I have installed automake now, when i try to run my program I now have the following error;

cd '/home/julien/programation/hello' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -f Makefile.cvs && mkdir '/home/julien/programation/hello/debug' && cd '/home/julien/programation/hello/debug' && CXXFLAGS="-O0 -g3" "/home/julien/programation/hello/configure" --enable-debug=full && cd '/home/julien/programation/hello/debug/./src' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -k hello
aclocal warning: macro `AM_PROG_LIBTOOL' not found in library
autoconf error: possibly undefined macro: AM_PROG_LIBTOOL If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation.
make: *** [all] Error 1
*** Exited with status: 2 ***

I see that this is the same error that the user have in question #7664, but the solution that seems to work for him does not for me since I have already
install buil-essential package.

I would also like to know if I would be able to use Kdevelop for my course ? the course will be given using borland c++ and I fear that the program generated by kdevelop wont run on the teacher computer that will be using borland C++. I would then have to reinstall WinXP to run borland c++, wich is not something I like to go back after using linux for 2 years. what do you think about that ?

thank you very much for your help, it is extremely appreciated. and please excuse me if my english is not very clear, it is my second language.
julien Martigny

Best julien martigny (julienmn) said : #3

I found my problem, i was missing the libtool package.

Christian Csar (cacsar) said : #4

You will probably be giving your teacher your code rather than the binary, so if it compiles fine in linux, you ought to be able to compile it in windows. However, if you have to write using windows specific libraries or functions then you might have some difficulty. Or if you are creating command line programs then windows may give the input in a different fashion I am not familiar with how windows gives the arguments to a command line function so you will have to check this.