Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Here is my terminal output for make practcal1 and the replacement that you provided.....


Code:
Gavin-McGuinnesss-MacBook-Pro:~ Gav$ make practical1
make: *** No rule to make target `practical1'.  Stop.
Gavin-McGuinnesss-MacBook-Pro:~ Gav$ g++ -o practical1 practical1.cpp
i686-apple-darwin10-g++-4.2.1: practical1.cpp: No such file or directory
i686-apple-darwin10-g++-4.2.1: no input files
Gavin-McGuinnesss-MacBook-Pro:~ Gav$

Your current working directory (cwd) is ~ (a.k.a. home, /Users/USERNAME) not your Desktop

Code:
cd ~/Desktop

first.

B
 
Please provide more information. In the same directory where you typed the make command line, enter this command and post the output:
Code:
pwd; ls -l

This is what I got when I typed in that code.

Code:
Last login: Thu Jan 20 18:59:46 on ttys000
Gavin-McGuinnesss-MacBook-Pro:~ Gav$ pwd; ls -l
/Users/Gav
total 32
drwx------+   7 Gav  staff   238 19 Jan 20:22 Desktop
drwx------+  10 Gav  staff   340 15 Dec 14:25 Documents
drwx------+ 103 Gav  staff  3502 19 Jan 15:37 Downloads
drwxr-xr-x@   9 Gav  staff   306 20 Jan 11:45 Dropbox
drwx------+  36 Gav  staff  1224 16 Jan 19:50 Library
drwx------+   9 Gav  staff   306 15 Dec 14:18 Movies
drwx------+   6 Gav  staff   204  9 Oct 18:59 Music
drwx------+  15 Gav  staff   510  2 Dec 18:22 Pictures
drwxr-xr-x+   5 Gav  staff   170  8 Oct 23:46 Public
drwxr-xr-x+   5 Gav  staff   170  8 Oct 23:46 Sites
-rwxr-xr-x    1 Gav  staff  8704 20 Jan 18:38 a.out
-rw-r--r--    1 Gav  staff    93 20 Jan 18:38 myHello.c

That inconsistency with program1 and practical1 was just a mistype... the name of the file that I want to run is practical1.cpp
 
This is what I got when I typed in that code.

Code:
Last login: Thu Jan 20 18:59:46 on ttys000
Gavin-McGuinnesss-MacBook-Pro:~ Gav$ pwd; ls -l
/Users/Gav

Code:
cd Desktop
or
Code:
cd ~/Desktop

EDIT: One way to make sure the file you want is in the current working directory is to use tab completion from the shell.

i.e.

Code:
make p<TAB>

keep hitting TAB until the name of the file you want shows up.

B
 
Your current working directory (cwd) is ~ (a.k.a. home, /Users/USERNAME) not your Desktop

Code:
cd ~/Desktop

first.

B

I LOVE YOU! No Homo!
I forgot one of the steps that we were told in college and that was to change where the program was going to save from desktop to USERNAME

PROBLEM SOLVED :):apple:

For all who care here is my fist program on my MBP

Code:
Gavin-McGuinnesss-MacBook-Pro:~ Gav$ make practical1
make: `practical1' is up to date.
Gavin-McGuinnesss-MacBook-Pro:~ Gav$ ./practical1
My first C++ program.
The sum of 2 and 3 = 5
7 + 8 = 15
Num = 6
 
Glad you got it going, Gavin! (Hey, that's alliteration!)

I suggest that you get yourself familiar with the Terminal (unix shell). You should have be comfortable enough that navigating to different directories, and doing basic file operations like copying, moving, renaming and deleting files should become second nature. You'll be doing a lot of it if you continue to learn how to do programming from a command-line environment.

It's also really good experience. Understanding Unix is a marketable skill that you can put on your resume, and it's one that has lasting value. It was useful back in the 70's and it's still useful today.

Become completely familiar with the following Unix commands:
cd (including the "~", "." and ".." directories)
ls (and its variants, ls -a, ls -l, etc.)
cat
cp
mv
pwd
echo

And your favourite text editor, be it TextEdit, or a Unix one like emacs, pico :)

And then of course your compiler tools:

make
g++
gdb (eventually)
 
Glad you got it going, Gavin! (Hey, that's alliteration!)

I suggest that you get yourself familiar with the Terminal (unix shell). You should have be comfortable enough that navigating to different directories, and doing basic file operations like copying, moving, renaming and deleting files should become second nature. You'll be doing a lot of it if you continue to learn how to do programming from a command-line environment.

It's also really good experience. Understanding Unix is a marketable skill that you can put on your resume, and it's one that has lasting value. It was useful back in the 70's and it's still useful today.

Become completely familiar with the following Unix commands:
cd (including the "~", "." and ".." directories)
ls (and its variants, ls -a, ls -l, etc.)
cat
cp
mv
pwd
echo

And your favourite text editor, be it TextEdit, or a Unix one like emacs, pico :)

And then of course your compiler tools:

make
g++
gdb (eventually)

Thanks... Is it weird that I am really excited to get stuck into some work?
Hah yes well I am doing a general engineering degree at the moment and in my 3rd year I chose a topic to specialise in... looking forward to learning more about computer engineering and software engineering in the years to come.
 
Ok I moved my project to a sub folder in my documents, How do I run that without having to move it back to the "Username" section?

OS X actually makes that pretty easy.

In Terminal, type
Code:
cd<SPACE>
Then drag the folder from finder to the Terminal window.

EDIT: or manually just
Code:
cd ~/Documents/Subfolder

As notjustjay suggests, mess around with some basic unix commands and get comfortable with them.

B
 
OS X actually makes that pretty easy.

In Terminal, type
Code:
cd<SPACE>
Then drag the folder from finder to the Terminal window.*


EDIT: or manually just
Code:
cd ~/Documents/Subfolder

As notjustjay suggests, mess around with some basic unix commands and get comfortable with them.

B

* I've done this and it works just fine!

Now one more question... Now that I have change my directory will it stay as that folder until I change it myself.

As I said I am really looking forward to learning more about terminal and coding.
 
Generally, yes. Until you issue another cd command or close the Terminal window.

Remember in Jurassic Park there's a scene in which the girl looks at a computer displaying some sort of 3-D overhead-flying render of the file system and she says "Hey, this is Unix! I know this!"

It's a silly scene, but maybe it can help with the Terminal frame of mind. With a desktop metaphor like OS X or Windows, you can have multiple folder windows open at once. When in a Terminal window, think of it like YOU are standing in one particular spot in your file system. You stay there until you move yourself. You can move yourself downward into another directory or back upward to the place you came from before. Like a little adventure game...

Every time you start a new Terminal, you're placed in the same folder, your "home" directory, like an adventure game placing you at the beginning of a level.

Hope that's helpful somehow :)
 
Remember in Jurassic Park there's a scene in which the girl looks at a computer displaying some sort of 3-D overhead-flying render of the file system and she says "Hey, this is Unix! I know this!"

Ahh, that brings back some memories. That was actually a real file manager that ran under IRIX. They actually have a clone that will run under OSX

http://fsv.sourceforge.net/
 
Here is my terminal output for make practcal1 and the replacement that you provided.....


Code:
Gavin-McGuinnesss-MacBook-Pro:~ Gav$ make practical1
make: *** No rule to make target `practical1'.  Stop.
Gavin-McGuinnesss-MacBook-Pro:~ Gav$ g++ -o practical1 practical1.cpp
i686-apple-darwin10-g++-4.2.1: practical1.cpp: No such file or directory
i686-apple-darwin10-g++-4.2.1: no input files
Gavin-McGuinnesss-MacBook-Pro:~ Gav$

You said you saved practical1.cpp from Smultron on your Desktop. Terminal doesn't start in your Desktop, it starts one step higher in your home directory.

Try:
cd Desktop
make pratical1

And see what you get. Make will complain if it has no Makefile AND it can't find a source file that matches its "default" behavior mentioned earlier.

For future reference, run:
pwd

to see your working directory. If it's not where you think it should be, you'll need to move around with cd.

-Lee

EDIT: Oops. I read to the bottom of page 1 and was replying based on that. Oh well, you got it going, good times.
 
Remember in Jurassic Park there's a scene in which the girl looks at a computer displaying some sort of 3-D overhead-flying render of the file system and she says "Hey, this is Unix! I know this!"

It's a silly scene, but maybe it can help with the Terminal frame of mind. With a desktop metaphor like OS X or Windows, you can have multiple folder windows open at once. When in a Terminal window, think of it like YOU are standing in one particular spot in your file system. You stay there until you move yourself. You can move yourself downward into another directory or back upward to the place you came from before. Like a little adventure game...

Every time you start a new Terminal, you're placed in the same folder, your "home" directory, like an adventure game placing you at the beginning of a level.

Hope that's helpful somehow :)

Ahh ok that is helpful... thank you man!

:)I now know where to come when I hit my next stumbling block!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.