GCC and C program use help

View: New views
2 Messages — Rating Filter:   Alert me  

GCC and C program use help

by madskier8806 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am very very very new at this, just taking my first class in C programming in UNIX.  Anyway, I am trying to use Cygwin, on my local machine since I will be away from internet access and will not be able to connect to my universities UNIX system.

I am having trouble getting my programs to run, I am testing and program I know compiles and runs correctly.
This is what my command screen looks like

User@ComputerName ~/Cygwin
$ gcc -o project1 project1.c

it compiles correctly, then I try what normally works on my normal UNIX system
$ project1
and I get an error
bash: project1:command not found.

Any help would be greatly appreciated, I appoligize for this greenhorn question.

thanks

Re: GCC and C program use help

by Mark Rutten :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> From: madskier8806 <madskier8806@...>
> Sent: Saturday, 3 November, 2007 5:06:35 PM
>
> it compiles correctly, then I try what normally works on my normal UNIX
> system
> $ project1
> and I get an error
> bash: project1:command not found.
>

I think you'll find that the problem is that you're current directory ('.') isn't in your path by default.  So you could try
$ ./project1

or add . to your path.


     
National Bingo Night. Play along for the chance to win $10,000 every week. Download your gamecard now at Yahoo!7 TV. http://au.blogs.yahoo.com/national-bingo-night/



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/