Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jan 2000 07:52:31 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Mikhail Evstiounin <evstiounin@adelphia.net>
Cc:        freebsd-questions@FreeBSD.ORG, "Ray D. Davis" <snoopy@mail.airmail.net>
Subject:   Re: How to run compiled program
Message-ID:  <20000115075231.O508@fw.wintelcom.net>
In-Reply-To: <003301bf5f6b$237d0b00$d0353018@evstiouninadelphia.net.pit.adelphia.net>; from evstiounin@adelphia.net on Sat, Jan 15, 2000 at 10:11:23AM -0500
References:  <003301bf5f6b$237d0b00$d0353018@evstiouninadelphia.net.pit.adelphia.net>

next in thread | previous in thread | raw e-mail | index | archive | help
* Mikhail Evstiounin <evstiounin@adelphia.net> [000115 07:34] wrote:
> I don't remember exatly when FreeBSD started to use new executable format,
> but try to do following first:
> ./ntest
> 
> A lot of times one doesn't have the current directory in your path (it does
> make sense, because it more secure) and system doesn't want
> to recognize any command in the current directory.
> 
> -----Original Message-----
> From: Ray D. Davis <snoopy@mail.airmail.net>
> To: freebsd-questions@FreeBSD.ORG <freebsd-questions@FreeBSD.ORG>
> Date: Friday, January 14, 2000 8:42 PM
> Subject: How to run compiled program
> 
> 
> >I am on ver 2.8.  I have compiled an equivalent of hello world in both c
> >and c++ using both the default a.out method and the -o option.  Yet when I
> >try to execute the file which is supposed to be linked, by typing
> >the file name, eg. ntest, the system says ntest: not a command.  Looking at
> >the contents of the file it
> >appears more like an object file than executable.  What is the dumb thing I
> >am doing???
> >

The dumb thing is not telling us how you are compiling the program,
you should be doing something like this:

gcc hello.c -o hello
./hello

-Alfred


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000115075231.O508>