[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 193
  • Last Modified:

Linux-executable

how do i produce an executable from a file that was created in c++?
0
jfeltus
Asked:
jfeltus
1 Solution
 
hernst42Commented:
Hi jfeltus,
you might try
gcc file.cpp -o binaryname
to create a executable from you c++ file

Cheers!
0
 
yuzhCommented:
You also make sure that the program has the excution bit set, "x" permision.

if not you need to, use chmod command to make it executable
eg:
chmod a+x filesname

#all users  can run filesname
man chmod to learn more details.
0
 
avizitCommented:
for c++ files I think the following would be better

g++ file.cpp

you can give output filename with the -o switch as

g++  -o test file.cpp    // where test is the executable filename

if you dont specify the -o switch the default executable output name is "a.out"
which you can execute as follows

g++ file.cpp
./a.out


0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now