Mac Xcode won't let me build and run.

macuser1232

macrumors 6502a
Original poster
Jan 20, 2012
666
3
Hey guys so I just started a new project on xcode using command line and then I clicked on C++. When I go to source files and then go to main.cpp it doesn't let me click on the build and run button at the top.
 

szymczyk

macrumors regular
Mar 5, 2006
168
8
You need to provide some more information for people to be able to help you. What version of Xcode are you using? Your mention of the Build and Run button tells me you're not using Xcode 4.

When you say the following:

using command line and then I clicked on C++
Do you mean you created a C++ command-line tool project?

Are you able to build and run the project from Xcode's menus? Xcode 2 and 3 have a Build menu that has a Build and Run menu item.

If you click the link in my signature, you can find two articles that walk you through the creation of a C++ command-line application project in Xcode. One article covers Xcode 4 and the other covers earlier versions of Xcode.
 

macuser1232

macrumors 6502a
Original poster
Jan 20, 2012
666
3
You need to provide some more information for people to be able to help you. What version of Xcode are you using? Your mention of the Build and Run button tells me you're not using Xcode 4.

When you say the following:



Do you mean you created a C++ command-line tool project?

Are you able to build and run the project from Xcode's menus? Xcode 2 and 3 have a Build menu that has a Build and Run menu item.

If you click the link in my signature, you can find two articles that walk you through the creation of a C++ command-line application project in Xcode. One article covers Xcode 4 and the other covers earlier versions of Xcode.
I'm on xcode 3.2.6

----------

I'm on xcode 3.2.6
if i just start a new project and don't edit the default coding at all it still won't let me build and run the project.
 

szymczyk

macrumors regular
Mar 5, 2006
168
8
If you create a different type of project, such as a Cocoa application, are the menu items in the Build menu enabled so you can build the project? Have you tried restarting Xcode? Something could have been messed up that a restart would fix.
 

macuser1232

macrumors 6502a
Original poster
Jan 20, 2012
666
3
If you create a different type of project, such as a Cocoa application, are the menu items in the Build menu enabled so you can build the project? Have you tried restarting Xcode? Something could have been messed up that a restart would fix.
I tried creating a different type of project and it still didn't let me build and run. Also by restarting do you mean quitting the application and then starting it again and trying? Because, I have already done that several times.
 

szymczyk

macrumors regular
Mar 5, 2006
168
8
by restarting do you mean quitting the application and then starting it again and trying?
Yes.

The only suggestion I can give is to uninstall Xcode and reinstall it. Instructions on how to uninstall Xcode are in the About Xcode and iOS SDK document that comes with Xcode. If uninstalling and reinstalling doesn't work, ask on Apple's Xcode mailing list. Some of Apple's Xcode engineers answer questions on the mailing list.
 

macuser1232

macrumors 6502a
Original poster
Jan 20, 2012
666
3
Yes.

The only suggestion I can give is to uninstall Xcode and reinstall it. Instructions on how to uninstall Xcode are in the About Xcode and iOS SDK document that comes with Xcode. If uninstalling and reinstalling doesn't work, ask on Apple's Xcode mailing list. Some of Apple's Xcode engineers answer questions on the mailing list.
Ok I'm re-downloading it now.
 

macuser1232

macrumors 6502a
Original poster
Jan 20, 2012
666
3
YAY! Re-downloading Xcode fixed the problem! I can build and run now!
Thanks bro!