LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   No Output (https://www.linuxquestions.org/questions/linux-newbie-8/no-output-96116/)

kesta73 09-23-2003 08:59 PM

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.

oulevon 09-23-2003 09:56 PM

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.

kesta73 09-23-2003 10:00 PM

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.


All times are GMT -5. The time now is 11:17 AM.