• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem creating command line application with Xcode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem creating command line application with Xcode


  • Subject: Re: Problem creating command line application with Xcode
  • From: Stuart Smith <email@hidden>
  • Date: Tue, 31 Jul 2007 22:50:40 -0700

On 7/31/07 5:15 PM, "email@hidden"
<email@hidden> wrote:

> Message: 16
> Date: Tue, 31 Jul 2007 20:13:47 -0400 (EDT)
> From: email@hidden
> Subject: Problem creating command line application with XCode
> To: email@hidden
> Message-ID:
> <email@hidden>
> Content-Type: text/plain;charset=iso-8859-1
>
> Please excuse my ignorance.
>
> I'm fairly new to C++ program, having gotten my feet wet using Visual
> Studio 6 and now having switched over to Mac I've decided to embrace
> XCode.
>
> I develop software for medical imaging research and use a package of
> classes called itk (insight toolkit, www.itk.org).
>
> For my first attempt to compile my previous code using XCode I performed
> the same steps I did with Visual Studio
>
> 1. produce a project file using cmake; I do this to allow for itk wrapping
> (ccmake -G Xcode .)
> 2. load in the project to Xcode
> 3. build the project
> 4. run it from the terminal command line
>
> Steps 1-3 work well.  I can even see the proper output of a simple program
> if I choose the "run & go" option.  However, when I open a terminal and
> type the file name to execute it, nothing happens.
>
> I've tried creating a new target (BSD shell tool), with no luck.
>
> I've even tried to create a new project, "Command Line Utility: C++ tool"
> compile and I still can't get it to run in a terminal window.
>
> The reason I want to run this in the terminal window is so I can run the
> program passing variables into it: I guess if I am able to do this through
> XCode, that would be a solution as well.
>
> Am I missing something very simple?
>
Probably. What is the result of the 'pwd' command in your terminal window?
Did you type in the full path to your new binary to run it, or at least
"./name_of_program" when in the correct directory? If the binary doesn't lie
on one of your PATHs, Mac OS X won't find it or run it. Even if your current
working directory is correct, "name_of_program" won't run the binary, but
./name_of_program will. It is a security thing.

You can input command line parameters to shell tools from Xcode. Choose
Project/Edit Active Executable from the menu . The resulting dialog (but not
how to get to it) is described in the Xcode user manual under "Configuring
Your Executable for Debugging".

hth, Stuart

> thanks
>
> Using XCode 2.4.1; OS 10.4.10; GCC 4.0 comipler; itk is compiled using
> c++, I've tried to change this but it won't let me for some reason.
> instead I aliased c++ to g++


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: configure/make not finding malloc.h
  • Next by Date: Re: configure/make not finding malloc.h
  • Previous by thread: Re: Problem creating command line application with XCode
  • Next by thread: Re: Xcode-users Digest, Vol 4, Issue 367
  • Index(es):
    • Date
    • Thread