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

macuser1232

macrumors 6502a
Original poster
Jan 20, 2012
668
4
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
187
17
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
668
4
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
187
17
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
668
4
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
187
17
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
668
4
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
668
4
YAY! Re-downloading Xcode fixed the problem! I can build and run now!
Thanks bro!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.