Click to See Complete Forum and Search --> : new with C++ programing


javmarcan
09-24-2002, 09:25 PM
Im just learning how to program in C++ and today I wrote my first code and compiled it.

but now i dunno how to run my program. I have my dot "o" file and I cannot run binary so whats next??

UprightMan
09-24-2002, 10:06 PM
What did you use to compile it? Since you are posting to a linux board, I will assume g++. If so, do this:

g++ -o executable_name object_file.o

Then,

./executable_name

For future reference,

g++ source.cpp

creates the executable a.out

javmarcan
09-24-2002, 10:14 PM
thanks uprightman. Now I was able to run my first C++

nuvan
09-24-2002, 10:16 PM
for future reference, to do the compiling and linking all in one step, just type
# g++ source_file.cpp -o output_file

that ought to do the trick for you...

HTH