Results 1 to 4 of 4
I am a relative novice at programing but I have and can write simple things.
I've been using microsoft visual studio express on windows for a while to create simple ...
- 06-19-2007 #1Just Joined!
- Join Date
- Jun 2007
- Posts
- 4
my binary doesn't do anything.
I am a relative novice at programing but I have and can write simple things.
I've been using microsoft visual studio express on windows for a while to create simple terminal "dos-prompt" apps for my self on windows. Now I am now running Debian Linux. I have spent several hours trying to figure out how to build something in Linux I tried apt-getting a few ide's and so on. Finally i decided to try to just write code into a text file and use g++ to compile it. So to test it and just figure it out how it works I wrote a simple few lines hoping that I could at least get someting to cout into the terminal. This is what I worte:
#include<iostream>
int main(void)
{
std::cout << "this tests make";
return 0;
}
I compiled it by typing "g++ -o test tmake.cpp
this seems to have worked it didn't output any errors and after a few seconds it returned a prompt. I assume it compiled the program. but wanted to be sure so I added some errors and tried to recompile which gave me error messages. I was satisfied that my program was being compiled so I returned the program to it's original state and recompiled again with no errors. Now I have a binary file however if I try to open it noting happens. Am I doing something wrong? or is my code bad or what,? I've been searching for an answer and trying things for several hours to no avail.
- 06-19-2007 #2Linux User
- Join Date
- Oct 2004
- Location
- /dev/random
- Posts
- 404
You need to run your program as
Replace test with whatever your binary name is.Code:./test
The program looks ok, no problems with it whatsoever.The Unforgiven
Registered Linux User #358564
- 06-19-2007 #3
- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 06-19-2007 #4Just Joined!
- Join Date
- Jun 2007
- Posts
- 4
Thank you much. That was helpful.


Reply With Quote

