LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-30-2003, 02:11 PM   #16
wapcaplet
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.

i.e.:

Code:
#include <iostream>
using namespace std;
int main() {
  cout << "Hello" << endl;
  return 0;
}
gcc test.cpp -o test
./test
 
Old 04-30-2003, 03:49 PM   #17
freemind
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()
{
printf("Hello\n");
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, 04:42 PM   #18
shadowbird
LQ Newbie
 
Registered: Apr 2003
Distribution: RedHat
Posts: 27

Rep: Reputation: 15
AhA!!!!!!!!!!!!!


"test" is a unix command. Try calling it something else like "foo" or "blah"
 
Old 04-30-2003, 08:12 PM   #19
freemind
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. )
 
  


Reply


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


All times are GMT -5. The time now is 11:54 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration