CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2008
    Posts
    2

    Smile Multi-Platform - What to use? Where to learn?

    Hello,
    I'm mostly programming in PHP and C#, but I have some experience (pretty basic) in C++. The most "complicated" thing I created was a window with some buttons and lists on it (using Win32 API), and playing with classes.
    Now, I want to get deeper into C++ - creating multi-platfrom (Windows, Linux, or even Mac if that is possible).
    When I want to open a file I can use Win32 API, but now, do I have to write the same code 2/3 times (for each OS)? And what about the GUI? What can I use and what not? Which IDE to use?
    Can anyone give me an online website or anything that can help me begin?

    Thanks,
    Ori Lahav.

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Multi-Platform - What to use? Where to learn?

    If you stay with standard C++ functions, and do NOT use any Win32 API calls, you can easily write portable code for files and such. There are various GUI libraries (WxWidgets comes to mind) that are available for most platforms.

    My real world experience has been that there is some functionallity that is best written using OS specific calls. In these cases, I have created a custom set of libraries that expose a unified interface. Now when I write an application, I simple call MY libraries. Depending on which OS I am targeting, I simply link against a different library.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Multi-Platform - What to use? Where to learn?

    The cross-platform GUI toolkit I've had the most experience with is GTK+. However, for some reason WxWidgets seems to get pushed a bit more around here, so maybe that might be worth checking out too.

  4. #4
    Join Date
    Oct 2008
    Location
    Tel Aviv, Berlin, L.A.
    Posts
    23

    Re: Multi-Platform - What to use? Where to learn?

    Another alternative is Qt (http://trolltech.com). I use it since its first release. However, to make it REALLY work on every platform and ARCHITECTURE, you need to know a little about makefiles, and stuff.
    It's free for *NIX systems. Under Windows you need to compile with "minGW" (gcc clone for Windows). As for an IDE, I use anaconda in *NIX (KDevelop is probably the better alternative). Since I BOUGHT Qt, I can use it (Windows) with VS. If you obtain the open edition, try dev-c++.
    ariell
    programming is understanding

  5. #5
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Multi-Platform - What to use? Where to learn?

    Quote Originally Posted by Lindley
    The cross-platform GUI toolkit I've had the most experience with is GTK+. However, for some reason WxWidgets seems to get pushed a bit more around here, so maybe that might be worth checking out too.
    To a large degree it is a matter of preference, and what you are familiar with. People with MFC backgrounds seem to prefer WxWidgets. People with a Tk/Tcl (also a viable alternative) seem to prefer GTK+.

    For most people I recommend spending some time (more than just a few hours....) with each one of them.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  6. #6
    Join Date
    Oct 2008
    Posts
    2

    Cool Re: Multi-Platform - What to use? Where to learn?

    Thank you very much!
    I coded wxWidgets and compiled (using wxDev C++ in Windows), switched to Linux, downloaded the packages and compiled for Linux.
    Making cross-platform GUI in C++ is so easy!

    About files location. In Windows I placed all the config and data files in the same folder as the program. Is it should be like this in Linux and Mac?

    Thanks again,
    Ori Lahav.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured