LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-23-2003, 08:59 PM   #1
kesta73
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, 09:56 PM   #2
oulevon
Member
 
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:
Quote:
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 17.4.1.2 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, 10:00 PM   #3
kesta73
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.
 
  


Reply



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 11:24 AM
tv output Shibby Linux - Software 1 06-07-2005 11:35 AM
Via AC'97 5.1 Optical Output or Audigy 4.1 Output Nza Fedora 3 06-01-2004 07:49 AM
the sound gives output when using mic but no output when run a music file medo Debian 0 04-19-2004 07:17 PM
Output of ls -l Crashed_Again Linux - Newbie 4 12-11-2003 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:55 AM.

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