Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

linux programming

Options
  • 09-11-2007 12:27am
    #1
    Registered Users Posts: 7,518 ✭✭✭


    I've to soon start a project that involves porting a windows (c++) server application to linux, which basically means learning about coding in linux. I'm comfortable using linux but have never coded for it.

    Does anyone know of any good tutorials \ sites that have information on porting apps from windows to linux or just linux programming in general?

    Also any tips people have to look out for would be appreciated.


Comments

  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Well C++ will work in Linux as well, only you need a Linux Compiler to compile your source.

    Obviously you will find parts not working etc but it shouldn't be too much trouble porting over. Any System() functions, probably won't work with it.

    Donal


  • Registered Users Posts: 7,518 ✭✭✭matrim


    Thanks webmonkey.
    I know c++ is available on linux, but the things I'm looking for is areas to look out for that might not be compatible. For example, the areas I know already are Database access (we currently use ADO), Settings in registry have to be move to file, Starting as a service \ daemon.

    I've found plenty of stuff on linux to windows, but it seems to be hard to find stuff on windows to linux.

    Also as I'm new to linux programming information on compilers \ dev environments would be helpful.
    What I'm looking into now is gcc (g++) but don't know much about what IDE's are available.


  • Registered Users Posts: 26,579 ✭✭✭✭Creamy Goodness


    IDE's in linux?

    vi + gcc = all you need in linux :p


  • Registered Users Posts: 7,518 ✭✭✭matrim


    Cremo wrote: »
    vi + gcc = all you need in linux :p

    That's what I'm using at the moment for smaller test programs, but for doing a large program (100+ cpp files including libraries) I'd perfer to have an IDE to take care of some of the small stuff.


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    Yeah you'd have some fun with VI with a large project :p


  • Advertisement
  • Registered Users Posts: 1,592 ✭✭✭kyote00


    Eclipse is probably the best option for the IDE. You will need the CDT plugin at:
    http://www.eclipse.org/cdt/

    The other thing to watch out for is that the build environment will be rather different as follows:
    a) What ever libraries you have been using on Windoze will probably need to be downloaded and compiled on Linux...
    b) you will also have the usual path and library_path to be set up for runtime also...
    c) any bat scripts need to go to .sh


    Which linux distro are you planning to use ? I would recommend either Ubunto or Fedora ...


  • Registered Users Posts: 7,518 ✭✭✭matrim


    kyote00 wrote: »
    Eclipse is probably the best option for the IDE. You will need the CDT plugin at:
    http://www.eclipse.org/cdt/

    The other thing to watch out for is that the build environment will be rather different as follows:
    a) What ever libraries you have been using on Windoze will probably need to be downloaded and compiled on Linux...
    b) you will also have the usual path and library_path to be set up for runtime also...
    c) any bat scripts need to go to .sh


    Which linux distro are you planning to use ? I would recommend either Ubunto or Fedora ...

    Thanks, I've taken a quick look into eclipse but need to look further. I used to use it for java programming but that was a couple of years ago.
    Does eclipse automatically create make files for you?

    At the moment we're targeting fedora mainly, but will probably move to Red Hat closer to release.


  • Closed Accounts Posts: 413 ✭✭sobriquet


    Hi matrim,

    As it's a server app is it safe to assume it's 'vanilla' C++? Ie, no MFC or heavy windows bindings? If so, porting should be reasonably straightforward (he said, optimistically and from miles away). AFAIK Eclipse is a fairly mature platform, but have a look at KDevelop and Anjuta, see what works for ye. No significant experience of any of these mind, but I know those two do create makefiles. Unsure about Eclipse though.

    If you're not familiar with Makefiles though, get a tutorial and create a small project to test hand writing them. Understanding them will benefit you in the long run. That goes for most things mind you.

    It might be worth having a browse through The Art of Unix Programming, which covers the Unix programming model. Should be a decent overview, though a lot won't apply to your situation. If it's a server app, does it use threading etc? If so that'll be some work, stuff like that will have lots of idiosyncracies.

    Subversion is a good source control solution btw, easy to configure and use from my experience.

    Best of luck.


  • Registered Users Posts: 2,082 ✭✭✭Tobias Greeshman


    Ok first things first, put the source under some sort of source control, whether it be cvs, subversion, git, etc, especially when you're dealing with such a large project (100+ source files).

    Someone suggested that C++ plugin for eclipse, personally I'd steer well clear of it, I tried to use it before and got nothing but problems with it. I personally just use vi/emacs and gcc. I've used anjuta before and found it to be quite good, kdevelop is good too but generates too much unwanted files for just a simple build.

    As for porting a server to unix, i'd say your first problem is going to be the network api's will be different. The Win32API's or system calls will need to translated into the relevant unix api's/system calls. I couldn't comment on the database porting, I've no experience here. Then there's nothing to say you won't have compiler issues as well. I've had problems in the past porting code that contained templates to gcc on linux.


Advertisement