From owner-freebsd-questions Tue Nov 17 18:38:24 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA05132 for freebsd-questions-outgoing; Tue, 17 Nov 1998 18:38:24 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from argate.com (calhoun1-691.resnet.drexel.edu [144.118.229.72]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA05125 for ; Tue, 17 Nov 1998 18:38:19 -0800 (PST) (envelope-from andriss@argate.com) Received: from localhost (andriss@localhost) by argate.com (8.9.1a/8.9.1) with SMTP id VAA26910; Tue, 17 Nov 1998 21:37:03 -0500 (EST) Date: Tue, 17 Nov 1998 21:37:03 -0500 (EST) From: Andriss To: G578@ix.netcom.com cc: freebsd-questions@FreeBSD.ORG Subject: Re: C executables In-Reply-To: <365231AD.3657@ix.netcom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >I know this sounds idiotic, but I can't get my "C" executables to run. >I've compiled with "cc" and with "gcc" (which I installed from the >packages), and I get no errors, and I create "a.out", but when I type >"a.out" to run the thing, I get "...not found." I'm new to C and new to >UNIX, so I'm probably doing something excrutiatingly dumb. It's just >that, this is how it worked in Caldera Linux, and this is how all the C >books say it should work in pretty much any UNIX environment. You >compile, you don't specify an object module name, it defaults to >"a.out", then you type "a.out" and, Voila, Hello World! Why am I >getting Voila, Not Found? > You know, it might just be a syntax error when you execute your programs. Suppose the program is called a.out, and is located in /home/user. First, you should type cd /home/user to get to that dir, then: ./a.out to execute the file. From what I see, you are missing that ./ part, and the shell looks for a.out in your $PATH, but not in current dir. Hope this helps, Andriss ________________________________________ Andriss@ArGate.com http://ArGate.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message