Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-23-2003, 09:59 PM   #1
LQ Newbie
Registered: Sep 2003
Posts: 4

Rep: Reputation: 0
No Output

Hey Guys,

I am a Linux newbie. I just wrote my first program - first.cpp.

#include <iostream.h>

int main()
std::cout << "First program";

I then compiled the program :

$g++ -o first first.cpp

No eroors.

I then try to run the executable

$ ./first

But, there is no output on screen. Also it DOES NOT show any error.

Any idea as to what the problem is?

I tried a C program also. It compiled successfully, but when executing the program, there is no output.

BTW, I am using RedHat Linux 8.0

Thanks in advance.
Old 09-23-2003, 10:56 PM   #2
Registered: Feb 2001
Location: Boston, USA
Distribution: Slackware
Posts: 438

Rep: Reputation: 30
That's funny. It works fine on my computer. It does give the following warning:
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
from first.cpp:1:
/usr/include/c++/3.2.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using
one of the 32 headers found in section of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
The first time I ran it, the output was on the same line as the prompt. So I added a newline, but it runs fine on my computer running GCC 3.2.2

By the way you might get a quicker reply next time if you put this in the programming forum.
Old 09-23-2003, 11:00 PM   #3
LQ Newbie
Registered: Sep 2003
Posts: 4

Original Poster
Rep: Reputation: 0
Yes, I know. I remember the first time I wrote a C program, the output did show up. I guess, something must have changed after that. And I cannot figure that out.

I realised I should have posted it on programming section and actually I posted it already.

Thanks for your reply, anyway.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
No output through SPDIf, but analog works. How do I get output through SPDIF? seanwnz Linux - General 11 11-08-2007 12:24 PM
tv output Shibby Linux - Software 1 06-07-2005 12:35 PM
Via AC'97 5.1 Optical Output or Audigy 4.1 Output Nza Fedora 3 06-01-2004 08:49 AM
the sound gives output when using mic but no output when run a music file medo Debian 0 04-19-2004 08:17 PM
Output of ls -l Crashed_Again Linux - Newbie 4 12-11-2003 07:28 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:10 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration