June 29, 2007

Writing programs for Linux?

Hi, say I have a program in standard C++, and it runs on the PC and Mac currently, but I want it to run on Linux as well, how do I decide on a distro to test it on? what distro do I compile it on? I don't want to install 50 distros on a pc just to make sure it works, any help?

  1. Not really, what I am asking is:
    How do I compile my programs for distribution onto the Linux platform? What distro should I use to test it on and compile it on?
  2. – QUOTE –
    Hi, say I have a program in standard C++, and it runs on the PC and Mac currently, but I want it to run on Linux as well,
    – END Q –

    If it is standard C++, it will work on Linux as well.

    – QUOTE –
    how do I decide on a distro to test it on?
    – END Q –

    Doesn't matter. All of them are Linux. Good bet it will work on other Unices as well.

    – QUOTE –
    I don't want to install 50 distros on a pc just to make sure it works, any help?
    – END Q –

    Just test your programs on _something_. It really doesn't matter which one. They are all Linuxen.

    – QUOTE –
    How do I compile my programs for distribution onto the Linux platform?
    – END Q –

    You know it's easier _not_ to compile, right? Source tarballs are a common form of distribution, and anyone can do a ./configure make make install sequence. So basically look up how to create configure and makefiles. That will tell you how to setup ./configure make for your project. Almost everyone on Linux has the tools needed for the compile (gcc and libraries). So they will typically do ./configure make make install.

    Compiling is a bit tricker. Actually, typically, you don't just compile, but also distribute in the appropriate package management solution. Google up the entire process as it is a bit more involved. It's also distribution specific. Example: All debian based Linux distros use apt. suSE has YAST. There's RPMs, typically associated with Fedora and a few others.

  3. The distro won't matter because they'll all come with the same gnu compiler.

    A distro is nothing more than a "branded" version of GNU/Linux.

    The Data Analyst - http://www.squidoo.com/thedataanalyst…

  4. So, the question you are asking is how to do I run a C++ Windows executable on a Linux machine.

    There are several ways to think about this.

    1. If you have the C++ source code, you can copy the source files onto the Linux machine and compile it yourself. For example, you can use g++ on Linux (it is free) to compile C++ code.

    2. If you don't have the source code, see if the program comes with a binary for linux

    3. If you can't do that. You can install a windows emulator on the Linux machine. Then you can run window programs. Here is a link for such an emulator - http://www.winehq.org/

    Have fun.

  5. looks like ubuntu is the winner and the opensuse the 2nd :)
  6. When I downloaded Ubuntu it didn't have a C complier (gcc)on the LiveCD, I had to download it separately.

    I would download PCLinuxOS because at I know that is more likely to include a complier with the LiveCD.

Tags: ,

Tell a Friend Today!

del.icio.us Digg Furl Reddit Ask BlinkList blogmarks Blogg-Buzz Google Ma.gnolia Netscape ppnow Rojo Shadows Simpy Socializer Spurl StumbleUpon Tailrank Technorati Windows Live Wists Yahoo! Help

Permalink • Print

Track this entry

RSS BlogPulse

RSS Technorati Cosmos

Related Searches

, , , ,