Compiling programs & building executibles from the available source codes

Posted on 2005-04-28
Last Modified: 2010-04-22
Please tell me in detail how to compile or build a program executible in linux. I have PCQ2005 linux installed(complete).I have downloaded mplayer source code, how do I compile it?
Question by:mhapsekar

    Author Comment

    Also indicate what all compilers are to be used & whether they are available in pcqlinux
    LVL 14

    Accepted Solution

    I'm not familiar with pcqlinux, but here are general instructions for compiling a program from source.

    First, you probably got the file as a .tar.bz2 or a .tar.gz, so you'll need to "unzip" it:
    For .tar.bz2:
    >bunzip2 mplayer.tar.bz2
    >tar -xvf mplayer.tar
    For tar.gz
    >tar -zxvf mplayer.tar.gz

    Next, cd into the new mplayer directory that was created.  You should see a file called INSTALL.  Do a 'less install' to read this file - it will have instructions for compiling/installing, and they will probably be something like this:

    Switch to root user:
    You will be asked for the root password
    #make install
    Switch back to regular user

    You will probably have a few dependencies (other programs that need to be installed first) with mplayer.  For most, these can be installed in a similar way.
    LVL 14

    Expert Comment

    >>Also indicate what all compilers are to be used

    'make' and 'make install' are script files that will call the correct compilers, which should (hopefully) be installed already.  If not, you will get an error message telling you which compiler you need.
    LVL 9

    Assisted Solution

    John has given the exact steps to build and install the player
    I summarize
    Most likely you might have gz extenstion
    use the command as mentioned by John
    1> Unpack the file with tar zxvf filename command
     i.e tar -zxvf mplayer.tar.gz

    2> Change the directory to the new sundirectory where the software is unpacked with a command such as this one:
         cd software_dir
    3> Read any README or INSTALL files to learn any specific instructions you must follow to build and install the software.
    4> The details of building the software may differ slightly from one software package to another, but typically you type the following commands to build and install the software:

        make install
    5> Finally read any other documentation that comes with the software to learn how to use the software and determine whether you must configure the software before using it.

    Best of luck


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    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…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    737 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

    21 Experts available now in Live!

    Get 1:1 Help Now