Posted on 2004-11-09
Last Modified: 2010-05-18
how do i produce an executable from a file that was created in c++?
Question by:jfeltus
    LVL 48

    Expert Comment

    Hi jfeltus,
    you might try
    gcc file.cpp -o binaryname
    to create a executable from you c++ file

    LVL 38

    Expert Comment

    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
    chmod a+x filesname

    #all users  can run filesname
    man chmod to learn more details.
    LVL 11

    Accepted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now