Error: multiple definitions of symbol _main

Joined
Apr 1, 2008
Messages
9
Reaction score
0
Points
1
Hi everyone!

Last week I went to a C++ course in uni. We learnt some of the basics of C++ and our final exam was to write a program that gave out the Mandelbrot set on a canvas.
So, today I tried to run the program at home but I got the following error:

/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: multiple definitions of symbol _main
class.o definition of _main in section (__TEXT,__text)
exam.o definition of _main in section (__TEXT,__text)
collect2: ld returned 1 exit status

That error came up when I was trying to bind(is that the correct word?) the programm using

g++ -o draw *.o

class.o is a programm defining complex numbers and exam.o is the one which should "draw" the mandelbrot set on the canvas.

Everything worked fine in uni, so I don't know where the problem is.

Any help would be much appreciated!

-frike
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top