www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/28/10:34:44

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=BAYES_00,FORGED_YAHOO_RCVD,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <25191024.post@talk.nabble.com>
Date: Fri, 28 Aug 2009 07:34:30 -0700 (PDT)
From: ken j <kjacks2006us AT yahoo DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Cannot get 'Hello World' to compile
In-Reply-To: <f60fe000908280604j6924f3a6wb294edefbdff7e3d@mail.gmail.com>
MIME-Version: 1.0
References: <25188895 DOT post AT talk DOT nabble DOT com> <f60fe000908280531j433aa646s7a26de5c0154c54e AT mail DOT gmail DOT com> <25189372 DOT post AT talk DOT nabble DOT com> <f60fe000908280604j6924f3a6wb294edefbdff7e3d AT mail DOT gmail DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

OK that helps. I'm new to Linux/Unix but I have some experience with DOS and
batch files, etc. Some things in Cygwin don't follow the same conventions as
DOS (or a DOSBox), obviously, like for example in DOS if an exe file is in
the directory you are in, you can just type the file name and it will
launch. In Cygwin you have to type the '/' first, even if you're already in
the file's directory. BTW I've found that I do NOT need to type './' but
rather only '/' to get an exe file to run in Cygwin. 

Also, all of my compiled executables go to c:\cygwin\home\username, not the
directory I'm in, which is c:\cygwin. I wouldn't be surprised if this output
placement can be modified, either on a case-by-case basis or globally. I am
going to do as you suggest and put the programs I will access frequently in
the \bin directory, and add that directory to my path string. My typing
skills are limited, and anything I can do to reduce keystrokes to achieve a
result is a priority for me.

Thanks again for your assistance - I have much to learn!

Ken  

 

Mark J. Reed wrote:
> 
> On Fri, Aug 28, 2009 at 8:51 AM, ken j  wrote:
>> That was it - using g++ as the compiler and changing the file name to
>> .cpp
>> The executable file was placed in my cygwin/home/username folder. Do I
>> have
>> to specify that folder in the set path variable for Cygwin to see it? I'm
>> not entirely clear on this issue.
> 
> You can always specify the path to an executable, in which case its
> directory doesn't have to be in your $PATH.  If you've just compiled
> it, it's probably in the same directory you're in, and you can just do
> 
> ./name
> 
> to run it.
> 
> If what you've created is a useful program that you want to keep
> around and be able to run as a command without specifying the path
> every time, then the thing to do is move it into a directory that's in
> your $PATH.  Many people have a "bin" directory in their home
> directory for adding their own commands to the system, and put
> "$HOME/bin" in the front of their $PATH.
> 
> -- 
> Mark J. Reed <markjreed AT gmail DOT com>
> 
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Cannot-get-%27Hello-World%27-to-compile-tp25188895p25191024.html
Sent from the Cygwin list mailing list archive at Nabble.com.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019