| Running Windows (or anything else) on your Mac Discussion of Classic or running Windows, Linux and other OSes on the Mac. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Jan 27, 2012
Location: western colorado
Posts: 5
![]() Mac Specs: imac osx 10.6.8
|
using osx 10.6, installed xcode 3.1.2 and successfully used.
Then used Terminal, compiled very small pgm - using one cout statement. Cannot execute or find compiled pgm even by using command g++ name.cpp -o outstuff. Compile seems to have been successful but I cannot find in any folder the output. I think that auto linking would be done - ?? Several net people said after compile - just type ./a.out to run. No workee. Thanks for any help - loux |
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,462
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
After you compile an app, unless you've specified a binary name, you should have an "a.out" binary. What are the commands you're executing?
Important Links: Community Guidelines : Use the reputation system if you've been helped. M-F Blog :: Write for the blog :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
![]() Member Since: Jan 27, 2012
Location: western colorado
Posts: 5
![]() Mac Specs: imac osx 10.6.8
|
|
| QUOTE Thanks | |
![]() Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,588
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff
|
Is your binary there when you do an ls? Your syntax is correct.
Code:
Mikes-iMac:foo mike$ g++ main.cpp -o foobar Mikes-iMac:foo mike$ ls foo.1 foobar main.cpp Mikes-iMac:foo mike$ foobar -bash: foobar: command not found Mikes-iMac:foo mike$ ./foobar Hello, World! Mikes-iMac:foo mike$ mike This machine kills fascists Got # ? phear the command line! |
| QUOTE Thanks | |
![]() Member Since: Jan 27, 2012
Location: western colorado
Posts: 5
![]() Mac Specs: imac osx 10.6.8
|
|
| QUOTE Thanks | |
![]() Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,588
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff
|
.. and you got no errors during compile, have full write permissions to the directory etc?
mike This machine kills fascists Got # ? phear the command line! |
| QUOTE Thanks | |
![]() Member Since: Jan 27, 2012
Location: western colorado
Posts: 5
![]() Mac Specs: imac osx 10.6.8
|
no errors during compile. full r w permission to source code. I do not know how to give full r/w permission the usr directory but I assume I am the only user the only admin on this personal mac in my home. Fantastic communications, Mike. I never knew that the forum would help this much - only signed on today.
Loux in Colo. |
| QUOTE Thanks | |
![]() Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,588
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff
|
Try adding a -v switch, and post the output. Also you can try doing it as..
g++ xtest.cpp.save -o ~/stuff at which point it should be in your home directory mike This machine kills fascists Got # ? phear the command line! |
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,462
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
You don't need the /Developer/usr/bin/ bit - gcc should be in your path.
![]() The command you executed is no different than what Dysfunction or I execute which creates a binary in the current working directory. It's hard to tell you what might be wrong with this since there is absolutely nothing wrong with your command. My only suggestion would be to check what Dysfunction mentioned - privileges for the current working directory. Out of what directory are you trying to compile this code? Important Links: Community Guidelines : Use the reputation system if you've been helped. M-F Blog :: Write for the blog :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
![]() Member Since: Jan 27, 2012
Location: western colorado
Posts: 5
![]() Mac Specs: imac osx 10.6.8
|
I never succeeded in compiling with g++ in terminal. I do wish to correct myself: I had xcode3.2.1 and not 3.2.2. I uninstalled 3.2.1 and downloaded xcode 3.2.2 for Apple. This version has a very nice interface for beginners. Click in new project ( in the intro ), click on Application and command line and you have a nice setup for c prog - using the good editor and build and run. Now I see no reason to mess around with terminal and g++. Just thought people would like to know. Thanks for the help I did get - Loux
Last edited by vansmith; 02-03-2012 at 05:25 PM. Reason: Language |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Differences; opening a file vs saving a file! | fncos | OS X - Operating System | 14 | 03-24-2010 12:54 PM |
| Moving mp3's to your Audiobooks folder | bobtomay | iPod Hardware and Accessories | 10 | 10-10-2009 12:02 PM |
| Info.plist to *open* a file | gamblor01 | OS X - Development and Darwin | 2 | 03-22-2009 11:00 PM |
| Host file modification | mastertag | OS X - Operating System | 4 | 07-11-2008 03:11 PM |
| Is .app the binary execute file? | AlexN | Switcher Hangout | 3 | 09-23-2005 11:11 AM |
All times are GMT -4. The time now is 06:32 PM.
Powered by vBulletin