GUI apps for Win/Linux/Mac in C/C++:
I want know how to write a "pure," "native," "API-level" apps for Windows, Linux, and Mac in C++.
I don't want "one-code run-anywhere", but native code for every OS.
Solution For Windows:
Just use Mingw/Win32 API
; it's very simple and clear. That way I like programming under Windows.
Solution For Linux:
If I use, for example, wxWidgets-dev/GNU G++
, my application can't run on PC/Linux if the user doesn't install wxWidgets
? If not, how do I include the wxWidgets
library in my program?
Solution For开发者_开发百科 Mac:
Is Objective-C++/GNU G++
is the solution? Or is Carbon/C++/GNU G++
the solution?
Mac
In the Mac case, you'll just want to fire up XCode and use Objective-C. Objective-C++ is mostly used to let you access existing C++ libraries from Objective-C.
Don't use Carbon, it's deprecated. It was only intended to make porting from Mac OS 9 easier.
Linux
This one is tough because there's really no guarantee of much of anything. You can be pretty sure that X Windows will be there, but there's a whole variety of libraries (Gnome, KDE, WxWidgets, FLTK, Motif, etc.) that may or may not be available.
In the old days, you could expect Athena widgets to be available, since they shipped with X Windows, but they look so crappy (somewhere between Mac OS 3 and Palm OS 1) that hardly anyone wants to use them any more.
So you pretty much have to pick a library/toolkit and use it, and expect your users to install it. Most distros make installation of dependencies really easy these days, so it's not as annoying as, say, installing wxWidgets on Windows.
精彩评论