D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] C++

 

At Thu 20 Nov 2008 10:05:31 UTC, peter <peter@xxxxxxxxxxxxxxxxxxxx> wrote:

> My recollection is one has different flavours of C++, particularly as
> regards the GUI (or API).  I do not think for instance that I can
> compile Microsoft C++ on my linux machine  (The stuff is just not in the
> libaries?).
>
> Before I stick my neck out and offer advice I am asking here to be sure
> of my facts before giving any. (If he wants to write in C++ that's his
> problem, however it would be nice if all platforms could run his game
> (which brings us back to Java (VBG).  In any case another member is
> talking of porting stuff to Linux.
>
> I know there is an ANSI C but is there a C++.  Or a way that makes the
> code work with the GNU C++ compiler.

Yes, there is an ANSI/ISO Standard for C++; there has been since 1998,  
and there's a new one due out any year now. So, plain C++ code that  
uses nothing but the standard libraries is portable across loads of  
platforms, including Windows and Linux.

However, the standard libraries do not include things like GUI and  
network libraries, so there are numerous versions of these, many of  
which are platform specific. On Windows, for example, you can write  
code directly against the Windows API, or use a class library such as  
MFC which is provided with the Microsoft compiler. OTOH, on Linux you  
can code against the POSIX APIs, and use the X API for GUIs.

If you want to write portable GUIs, use a toolkit such as Qt or  
WxWidgets or SDL which is designed to be portable. The same goes for  
networking and just about everything else.

Anthony
-- 
Anthony Williams
Author of C++ Concurrency in Action | http://www.manning.com/williams

Custom Software Development | http://www.justsoftwaresolutions.co.uk
Just Software Solutions Ltd, Registered in England, Company Number 5478976.
Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK



-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html