Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jun 2002 01:42:14 -0700
From:      "James" <effdefender@earthlink.net>
To:        "Freebsd-questions" <Freebsd-questions@freebsd.org>
Subject:   Compiling and executing a simple program
Message-ID:  <001201c22012$089b70a0$0301a8c0@sys.gtei.net>

next in thread | raw e-mail | index | archive | help
Ok, I got my FreeBSD system up and running.  While I'm waiting for KDE to
finish installing from the ports collection, I decided to telnet into my
FreeBSD machine from my Windows '98 machine.

I wrote a "hello world" program in C++ and tried to compile it and execute
it.
Just to make sure I was doing everything right, I telneted in to my school's
(well, ex-school's) server and did it there.  I had no problems on the
school's server.

Anyone know why this wouldn't work?
The program will compile, but when I type in the name of the file to execute
it, it does not work.
I've pasted some of the commands I typed below.
Does anyone have any ideas?  Am I missing something?  If I am, can someone
point me in the right direction?
Thank you,
James Turnbull


$ cat hw.cpp
#include <iostream.h>


int main ()
{
  cout << "Hello World!";
  // created on June 30, 1:03 AM from my PC
  return 0;
}
$ g++ -o hw hw.cpp
$ hw
hw: not found
$ ls
HW      hw      hw.cpp  hw1
$ hw
hw: not found
$



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?001201c22012$089b70a0$0301a8c0>