Quick questions regarding C++

manno

Registered Member
Joined
Apr 26, 2010
Messages
79
Reaction score
35
If I code a program in C++ in Xcode on a Mac, can the code be compiled in Windows without changing a single line?

Also, is it possible to build a GUI for Windows, and build a GUI for Mac from the same C++ base program?

Is it possible to build a GUI for Mac for a C++ program at all??
 
Yes, it's possible. You need to use a cross platform framework like QT that's a solid alternative in order to port the same code to windows, mac, linux and mobile platforms without changing a line of code and without sacrificing (well, too much..) the sheer speed of a native UI c++ app. No .net / bytecode crap.

There are other toolkits that are multi-platform like wxwindows but QT is commercially backed (Nokia owned) while being free and in my opinion the most mature of them all. Plus it's written in c++ for c++ as requested, there's plenty of docs and code around and the development environment it comes with (for win, mac and linux) is really top notch.

HTH
 
Yes, it's possible. You need to use a cross platform framework like QT that's a solid alternative in order to port the same code to windows, mac, linux and mobile platforms without changing a line of code and without sacrificing (well, too much..) the sheer speed of a native UI c++ app. No .net / bytecode crap.

There are other toolkits that are multi-platform like wxwindows but QT is commercially backed (Nokia owned) while being free and in my opinion the most mature of them all. Plus it's written in c++ for c++ as requested, there's plenty of docs and code around and the development environment it comes with (for win, mac and linux) is really top notch.

HTH

Thanks, that's what I was looking into but wasn't sure it was any good.

We'll see how it goes with Qt.
 
Hello there,

I've been programming in C for several years now and C++ for a good two. So I have pretty good experiences with both.
I've also worked with GTK+ and Qt in the past for my own personal usage and applications for some clients.

To sum it up, if you want to do cross-platform GUI programming in C++, you have a few options :

- WXwidgets (C++)
- GTKmm (a C++ wrapper of GTK+ and uses glibmm)
- Qt (C++)
...

Those are the main ones, there are a few others though.

But out of all the libs I would recommend Qt, it's a very good framework :
- Good GUI library
- Also has networking libraries, multimedia libraries
- So it's actually a very complete framework and can be used to do much more than simple GUI programming which isn't really the case of WXwidgets or GTKmm.

So I think Qt is really a no brainer. It's brilliantly cross platform so it works with about no code changes on Windows, Mac OS X and most Unixes with X11 (Linux, BSD ...). And to make it even better, Qt comes bundled with a great bunch of tools.

- QtDesigner (GUI design)
- And better QtCreator(an IDE with GUI design integrated, very easy to use)

Hoping that this information is useful.

Yours sincerely, Xooor.
 
Back
Top