Geting KDevelop to compile.

benjamin j collar bcollar at unm.edu
Tue Jan 4 16:43:56 GMT 2000


Hello,

>When I run I get this.c++  -O0 -g3 -pg -Wall     -o
>p_one  it.o main.o  
>main.o: In function `main':
>/home/digit/p_one/p_one/main.cpp:26: multiple
>definition of `main'
>it.o:/home/digit/p_one/p_one/it.cpp:20: first defined
>here

the linker is telling you here that in it.cpp you already have a main
defined.

>/usr/bin/ld: Warning: size of symbol `main' changed
>from 34 to 50 in main.o
>collect2: ld returned 1 exit status
>gmake: *** [p_one] Error 1
>*** failed ***

Now you're also defining one in main.cpp.  And pow there's the
problem--you define main in two different files.
When the linker comes along it sees two definitions of main
and doesn't know what to do.

What do you need to do?  First, main.cpp is a complete program in
itself--you don't need to link in it.o as you do on the g++ line
above.  So your compile line should be:

c++  -O0 -g3 -pg -Wall -o p_one main.o

that should get your program working.  I don't know what's in it.cpp
though so I can't help you there.

good luck
Ben

 > >What is the problem ware is it geting 
>it.o:/home/digit/p_one/p_one/it.cpp:20: first defined
>here  
>
>Pleas help.. All I want to do is the lessions out of
>my c++ book one at a time??? 
>
>
>__________________________________________________
>Do You Yahoo!?
>Talk to your friends online with Yahoo! Messenger.
>http://messenger.yahoo.com
>

---------------------------
Ben Collar
http://www.unm.edu/~bcollar/
Finger me for my public key (finger bcollar at www.unm.edu)
Colbe Cofor





More information about the KDevelop mailing list