Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to use Xcode Tools with a Command Line Project

I'm using Xcode 3.2.6, C compiler. I've had an application for years that is command-line on the terminal, compiling with a makefile. Now I want to actually use the performance tools included with Xcode, such as threads, time profiler, etc. How do I do this?


I created a project for it (never did that before), added source files, etc -- it seems to work. It created the application, which will run via the terminal like always. But whenver I try to use Run (inside Xcode), a window opens up saying "Stop Executable". I have to click OK and that's the end of it. Nothing has happened.


I found an old query on the web similar to this from 2008. The suggestion was to open the console. Still nothing. "Sync with Debugger" does no good. Please help!

PowerMac, OS X Mountain Lion (10.8.2)

Posted on May 28, 2014 8:29 AM

Reply
12 replies

May 29, 2014 12:13 PM in response to rhhlewis

What type of project did you create? Without this information, no one will be able to help you.


You have two options to create a command-line app. The first option is to create an external build system project. You should use this option if you're using a makefile to build the project. The advantage of the external build system project is you can use your makefile to build the project. The downside of the external build system project is limited support for running the app inside Xcode, which is what you may be experiencing.


The second option is to create a command-line tool project. With a command-line tool project, you use Xcode instead of a makefile to build the project. But Xcode has better support for running your app inside Xcode if you use a command-line tool app.


What's more important to you: using a makefile or running your app in Xcode? If using a makefile is more important, create an external build system project and accept Xcode's limitations when running and debugging external build system projects. If running your app in Xcode is more important, create a command-line tool project.

May 29, 2014 3:56 PM in response to Frank Caggiano

That I understood. I did try Run > Console. Nothing intelligible happened. Then I synced with the debugger. he program is called fer64. I get this:


No executable file specified.

Use the "file" or "exec-file" command.

No executable file specified.

Use the "file" or "exec-file" command.

The program being debugged is not being run.

The program being debugged is not being run.

Not executing.

(gdb) r fer64

Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Con tents/Resources/PBGDBIntrospectionSupport.A.dylib")

Starting program: fer64

Not executing.

May 29, 2014 4:40 PM in response to rhhlewis

Ah that's right Xcode 3 did things a lot differently. Sorry as I said it's been a while since I ran 3 and my memory of it is fuzzy.


While upgrading to 5 probably won't fix your problem it will get you better support, you're not going to find to many people still running 3. At least if you were using 5 we'd be talking the same language 😀


good luck


regards

How to use Xcode Tools with a Command Line Project

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.