Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CuteBoA

macrumors newbie
Original poster
Mar 12, 2010
21
0
Line Location Tool:0: Command /Developer/usr/bin/g++-4.0 failed with exit code 1


Line Location Tool:0: duplicate symbol _main in /Users/indahandriani/Desktop/a/build/a.build/Debug/a.build/Objects-normal/i386/a.o and /Users/indahandriani/Desktop/a/build/a.build/Debug/a.build/Objects-normal/i386/main.o


hello, anyone know whats the problem with that? and what should i do with that?
thank you!
 
The problem is that you are compiling/linking two different files which both have a main() function. There can only be one main() in your application.
 
That answer doesn't really mean much. Are you compiling on the command line or from within Xcode? If you are compiling from within Xcode it already has a default main() function defined so you don't need to define your own (assuming you chose the correct project template).

im still pretty confused with how Xcode works.. what is command line?
usually i write my program in .cpp file, and then i press build and debug..
so what does that meann?
i never had this kind of problem before..

i usually compile the one with. xcodeproj
 
OK, we now understand you are using Xcode.

Could you tell us how many files end in either ".c", ".cp" or ".cpp". As well as their names!

aaa.cpp
main.cp
TApplication.cp
TCarbonEvent.cp
TEventHandler.cp
TNib.cp
TWindow.cp

thats it!
 
The easiest way to help is to have you create a new project with the setting you see below. Name the project whatever seems appropriate to you.

Screen shot 2010-04-05 at 3.16.35 PM.png

Once the project is open you'll see it contains a file "main.cpp".

Screen shot 2010-04-05 at 3.17.45 PM.png

Open "main.cpp" replacing it's contents with yours.

Compile, run and enjoy!!!
 
The easiest way to help is to have you create a new project with the setting you see below. Name the project whatever seems appropriate to you.

View attachment 220936

Once the project is open you'll see it contains a file "main.cpp".

View attachment 220937


Compile, run and enjoy!!!

i cant seem to find how to make mine like the first picture..
what should i do to make that box appear?

picture1vj.png
 
You are running an older version of Xcode, so select "Command Line Utility" from the list on the left side of that Dialog-Window. The content on the right side may change allowing you to choose a C++ type project, which is what you want!
 
You are running an older version of Xcode, so select "Command Line Utility" from the list on the left side of that Dialog-Window. The content on the right side may change allowing you to choose a C++ type project, which is what you want!

it works now!! thank you so much for helping me!:D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.