Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Xcode: Command Line Interface Gone? :-o

Xcode: Command Line Interface Gone? :-o
Thread Tools
jessejlt
Mac Enthusiast
Join Date: Feb 2003
Location: Portland, Oregon
Status: Offline
Reply With Quote
Oct 25, 2003, 02:12 AM
 
In PB, I was able to write my command-line C / C++ programs and hit command-R to compile and then run them. When ran, an I/O interface would appear, but in Xcode, no such luck. Any ideas of what's going on here? Does Xcode no longer support command-line I/O?
jesse ;-)
     
Tritium
Junior Member
Join Date: Jan 2003
Status: Offline
Reply With Quote
Oct 25, 2003, 01:39 PM
 
Works for me, I see the same style run window with the standard output and error of the program running. Just select new projet and "standard tool" and build it, the default program prints hello world.
     
jessejlt  (op)
Mac Enthusiast
Join Date: Feb 2003
Location: Portland, Oregon
Status: Offline
Reply With Quote
Oct 25, 2003, 02:08 PM
 
Try this:

#include <stdio.h>

int main ()
{
int i;

printf( "Enter a number\n" );
scanf( "%d", &i );

return 0;
}

Doesn't do anything. If I hit the carriage return, than the message "Enter a number" prints and then it returns 0. In PB, the message "Enter a number" would print, then it would accept an integer, then it would return 0.
Is this not the same behavior you're getting?
jesse ;-)
     
cheerios
Professional Poster
Join Date: Apr 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
Oct 25, 2003, 02:32 PM
 
I've had that problem in PB before... i don't think it's an XCode-specific problem. my solution: go code simple stuff in simple applications! open a terminal, navigate to your file, and type g++ foo.cpp. that'll compile.
type ./a.out to run. up arrrow will return your prev command, so you can change your code, save it, then up twice to compile, up twice more to run I don't remember ever finding a better way about the problem, other than feeding it all it's input before it prompts for it...

edit: in fact just ran that code in PB(december build), and it did the same thing...
Code:
4 Enter a number testing has exited with status 0.
time to start gripin' to apple looks like...
The short shall inherit the earth. Just you wait. You won't see us coming. We'll pop out from under tables, beds, and closets in hordes. So you're tall, huh? You won't be so tall when I chew off your ankles. Mofo
     
Wes
Junior Member
Join Date: Apr 2001
Status: Offline
Reply With Quote
Oct 25, 2003, 07:45 PM
 
I am having a similar problem with Xcode. I am trying to build and run a simple java tool, yet I keep getting a weird error. When I open the project as a .pbproj it works fine, but not when I open it as a .xcode

here is the run log...

java.util.zip.ZipException: No such file or directory
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:112)
at java.util.jar.JarFile.<init>(JarFile.java:117)
at java.util.jar.JarFile.<init>(JarFile.java:55)
Exception in thread "main"
java has exited with status 1.


Any ideas?
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:43 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,