LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Problem with KDevelop (https://www.linuxquestions.org/questions/programming-9/problem-with-kdevelop-116459/)

Thaith 11-15-2003 04:51 PM

Problem with KDevelop
 
/bin/sh /root/Programming/learnc/admin/missing --run automake --gnu learnc/Makefile
aclocal.m4:3009: your implementation of AM_INIT_AUTOMAKE comes from an
aclocal.m4:3009: old Automake version. You should recreate aclocal.m4
aclocal.m4:3009: with aclocal and run automake again.
gmake: *** [Makefile.in] Error 1
*** failed ***

That's what I recieved when I try to compile a very simple C program. Has anyone experienced with it? How to solve? . Help me!

Mara 11-15-2003 05:07 PM

Open a terminal and do as the smessage suggest, what means
su
(enter root password when asked)
aclocal
Then try to compile the program again.

Thaith 11-16-2003 09:52 AM

UMM, I will try, thanks, but is there better way ?

Thaith 11-16-2003 10:42 AM

I do as you told, and when I compile, the result is:
cd .. && \
/bin/sh /root/Programming/learnc/admin/missing --run automake-1.6 --gnu learnc/Makefile
cd .. && perl admin/am_edit learnc/Makefile.in
cd .. && /bin/sh ./config.status learnc/Makefile depfiles
config.status: creating learnc/Makefile
config.status: executing depfiles commands
source='temp.c' object='temp.o' libtool=no \
depfile='.deps/temp.Po' tmpdepfile='.deps/temp.TPo' \
depmode=gcc3 /bin/sh ../admin/depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I.. -O2 -O0 -g3 -Wall -c `test -f 'temp.c' || echo './'`temp.c
temp.c:22:14: warning: no newline at end of file
*** success ***

It seems OK.
But when I try to execute it, the result is :

gmake all-recursive
gmake[1]: Entering directory `/root/Programming/learnc'
cd . && \
/bin/sh /root/Programming/learnc/admin/missing --run automake-1.6 --foreign Makefile
cd . && perl admin/am_edit Makefile.in
cd . && /bin/sh ./config.status Makefile
config.status: creating Makefile
gmake[1]: Leaving directory `/root/Programming/learnc'
gmake[1]: Entering directory `/root/Programming/learnc'
Making all in learnc
gmake[2]: Entering directory `/root/Programming/learnc/learnc'
Making all in docs
gmake[3]: Entering directory `/root/Programming/learnc/learnc/docs'
cd ../.. && \
/bin/sh /root/Programming/learnc/admin/missing --run automake-1.6 --gnu learnc/docs/Makefile
cd ../.. && perl admin/am_edit learnc/docs/Makefile.in
cd ../.. && /bin/sh ./config.status learnc/docs/Makefile
config.status: creating learnc/docs/Makefile
gmake[3]: Leaving directory `/root/Programming/learnc/learnc/docs'
gmake[3]: Entering directory `/root/Programming/learnc/learnc/docs'
Making all in en
gmake[4]: Entering directory `/root/Programming/learnc/learnc/docs/en'
cd ../../.. && \
/bin/sh /root/Programming/learnc/admin/missing --run automake-1.6 --gnu learnc/docs/en/Makefile
cd ../../.. && perl admin/am_edit learnc/docs/en/Makefile.in
cd ../../.. && /bin/sh ./config.status learnc/docs/en/Makefile
config.status: creating learnc/docs/en/Makefile
gmake[4]: Leaving directory `/root/Programming/learnc/learnc/docs/en'
gmake[4]: Entering directory `/root/Programming/learnc/learnc/docs/en'
gmake[4]: Nothing to be done for `all'.
gmake[4]: Leaving directory `/root/Programming/learnc/learnc/docs/en'
gmake[4]: Entering directory `/root/Programming/learnc/learnc/docs'
gmake[4]: Nothing to be done for `all-am'.
gmake[4]: Leaving directory `/root/Programming/learnc/learnc/docs'
gmake[3]: Leaving directory `/root/Programming/learnc/learnc/docs'
gmake[3]: Entering directory `/root/Programming/learnc/learnc'
/bin/sh ../libtool --silent --mode=link gcc -O2 -O0 -g3 -Wall -o learnc temp.o hello.o main.o
hello.o(.text+0x0): In function `main':
/root/Programming/learnc/learnc/hello.c:19: multiple definition of `main'
temp.o(.text+0x0):/root/Programming/learnc/learnc/temp.c:19: first defined here
main.o(.text+0x0): In function `main':
/root/Programming/learnc/learnc/main.c:26: multiple definition of `main'
temp.o(.text+0x0):/root/Programming/learnc/learnc/temp.c:19: first defined here
collect2: ld returned 1 exit status
gmake[3]: *** [learnc] Error 1
gmake[3]: Leaving directory `/root/Programming/learnc/learnc'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/root/Programming/learnc/learnc'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/root/Programming/learnc'
gmake: *** [all] Error 2
*** failed ***

How to solve this ? . Sorry if I have bothered you. I am newbie :D

Mara 11-16-2003 03:20 PM

Quote:

/bin/sh ../libtool --silent --mode=link gcc -O2 -O0 -g3 -Wall -o learnc temp.o hello.o main.o
hello.o(.text+0x0): In function `main':
/root/Programming/learnc/learnc/hello.c:19: multiple definition of `main'
temp.o(.text+0x0):/root/Programming/learnc/learnc/temp.c:19: first defined here
main.o(.text+0x0): In function `main':
/root/Programming/learnc/learnc/main.c:26: multiple definition of `main'
temp.o(.text+0x0):/root/Programming/learnc/learnc/temp.c:19: first defined here
collect2: ld returned 1 exit status
The example code you're trying to compile has a mistake. In both hello.c and main.c (and also in temp.c) there's 'main' finction. Their objets are linked and it produces and error, because the result can have only one main functions and there are 3 candidates...
It won't work this way...You need to change it, comment out two mains or do something different. Hard to say without having the sources.

Side note: don't program when you're logged as root! When you're root, a mistake may result in really bad ways. Create a new account and use it for programming (and most other things).

Onemessedupjedi 11-17-2003 01:01 AM

and you could also give permission to your name to write to the directories you know the program will be installing to....however that reduces security greatly because you are allowing anyone and everyone to install anything on your system including a virus...but then again this is linux....

Roadhog 02-04-2004 08:01 AM

Hi Mara,

I tried what you suggested. I am running RH9 with all updates, KDev 2.1.5 and QT 3.1. You obviously know your stuff but I am a MS windows user trapped on teh dark side. Your instructions to me, are not complete. Fine, run terminal, type su, then pwd. When I do this I see an error "need configure.an or configure.in". In KDevelop, I can simply run Autoconf and Automake from the build menu, but this is but a bandaid, does not address the problem at the core. As I would need to do this with every new program I create.

You linux gurus have both my admiration and respect, but you have to cut us MS-Windows newbs who are trying to leave the dark side and learn, some slack.

As I help individuals with MS Windows issues, I treat all as if they know absolutely nothing, I leave out no steps in the process of what I want them to do. I always remember that once, I knew aboslutely nothing about windows, the registry, processes, etc.

Guess I am just frustrated that everywhere I go on the net to get help, information is fragmented and what should be a simple process, becomes an ordeal. This is not an attack on you or the community, just the ramblings of someone who wants to learn, but is tired of locked dorrs.

Roadhog

Mara 02-04-2004 03:37 PM

First more compilicated mathod - to compile them all by hand (I give it just in case):
Code:

cd /root/Programming/learnc/learnc/
gcc -O2 -g3 -Wall -o temp temp.o
gcc -O2 -g3 -Wall -o hello hello.o
gcc -O2 -g3 -Wall -o main main.o

You should get 3 exacutables.

Now using KDevelop... I don't remember 2.1 well (using 3.x for months now), but there should be something as creating new targets. Target is nothing more as separate executable (not always, but...). You need to create 2 targets - one for every of the 3 files (the first one already exists). When you have the targets created, add the .c files to targets (one .c file for target). When you try to compile it (you need to run automake first) they should compile as 3 executables.

I can't give you simplier advice - I don't have KDevelop 2.x to see where's the option.

Roadhog 02-05-2004 07:18 AM

Thank you Mara,

Coming from a Windows, DevStudio environment, this is all so new as DevStudio definitely makes one lazy. I feel I have leanrt a lot in the last three weeks and have so much more to learn. Mastering the command line and definitely learn emacs are priorities. Just finding the time. And to boot, I am relatively new to C++.

Took a deep breath lastnight and am refocused. Hopefully it will all start to fall together soon.

roadhog

escale 02-04-2006 03:12 PM

Anyone:
I know this thread is probably in the archives, but I too am trying to get KDevelop going on my Linux box.

After encountering the aclocal error, I found this post.
I su to root and executed:
#aclocal
and got this error message:
aclocal: 'configure.ac' or 'configure.in' required
so I typed in
#locate configure.ac
nothing came back so I typed in:
#locate configure.in
and I got a bunch of lines. I noticed that this one in particular caught my interest:
/home/dan/CProg/KDevvProj/firstproj/configure.in
as this was my working Kdevelop directory, so I changed my directory as follows:
#CD /home/dan/CProg/KDevvProj/firstproj
and then executed the statement:
#aclocal
the system didn't return an error message, and appeared to do nothing, so I went back to kdevelop using my usual login in and entered Kdevelop again. My "Hello World" program finally compiled.

This information if for others who may encounter this particular aclocal error and would like to get their KDevelop package running. I don't know what caused the error or why aclocal needs to be run, but this worked for me.


All times are GMT -5. The time now is 03:56 PM.