Results 1 to 3 of 3
Yes, I have the same problem. I tried both gcc and g++ in both c and c++ way. And even in a gdb, it output correctly, but in the terminal, ...
- 09-22-2009 #1Just Joined!
- Join Date
- Sep 2009
- Posts
- 1
no output in terminal window
Yes, I have the same problem. I tried both gcc and g++ in both c and c++ way. And even in a gdb, it output correctly, but in the terminal, it don't work!!
This is the code:
#include <iostream>
int main(){
// (void)printf("Hello world!\n");
std::cout << "Hello World!" << std::endl;
return 0;
}
This is the output in gdb:
(gdb) run
Starting program: /home/jin/Documents/Programming/Database/test
Hello World!
This is the terminal:
jin@Jin-R52:~/Documents/Programming/Database$ test
jin@Jin-R52:~/Documents/Programming/Database$
Can anyone help me? Or any suggestion?
Thanks
- 09-22-2009 #2
Do not use the name test for your program.
There is a test command installed on your system.
It will run, instead of your program.
- 09-22-2009 #3
It's OK to use "test" as the name of your program - but the thing is, the current directory usually isn't on the PATH anyway...
Running "which test" will probably tell you /usr/bin/test
If you want to run a program called "test" in the current directory, run "./test", not "test".


Reply With Quote
