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 04-30-2003, 03:11 PM   #16
LQ Guru
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48

I just thought of something... someone else just asked a similar question. Did you make sure to print a newline (endl, or "\n") after printing "Hello" from your program? Output doesn't always go to the screen unless you send a newline.


#include <iostream>
using namespace std;
int main() {
  cout << "Hello" << endl;
  return 0;
gcc test.cpp -o test
Old 04-30-2003, 04:49 PM   #17
LQ Newbie
Registered: Apr 2003
Posts: 7

Original Poster
Rep: Reputation: 0
My source code is:

/*Filename: test.c
make command: gcc -o test test.c

#include <stdio.h>

int main()
return 0;

Pretty simple and includes newline. It always works with "./test" but not with "test"

Kevin, I'm not getting any error messages and it just returns to prompt when I run "test".

The whole path is: .:.:.:/bin/:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/home/XL/bin:/home/XL/bin

Thank you so much!
Old 04-30-2003, 05:42 PM   #18
LQ Newbie
Registered: Apr 2003
Distribution: RedHat
Posts: 27

Rep: Reputation: 15

"test" is a unix command. Try calling it something else like "foo" or "blah"
Old 04-30-2003, 09:12 PM   #19
LQ Newbie
Registered: Apr 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Kevin, you are so right!!!!! Many thanks. ( I should remember I encountered the same problem in UNIX. )


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
stock kernel 2.4.31 compiled with wrong gcc? uselpa Slackware 6 09-26-2005 02:35 AM
Wrong GCC version during compile? raid517 Linux - Software 4 09-14-2005 09:46 AM
Missing gcc or wrong version NoobVer.01 Fedora - Installation 1 08-19-2005 03:00 AM
LFS: gcc from wrong location??? 7.e.Q Linux From Scratch 0 07-08-2004 03:55 AM
mplayer - wrong gcc flags crashmeister Linux - Software 2 11-19-2002 07:25 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:26 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