473,230 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

Cross-platform C++ programming

I'd like to develop a simple cross-platform application in C++. I'd
like it to run in Windows, OS X, PC-BSD and Linux. From my research, it
seems I should use Qt or Gtk as a graphical library. Do you agree? Do
you have other tips? How Cygwin could help me? Thanks.

Dec 26 '06 #1
7 2590

Charles wrote:
I'd like to develop a simple cross-platform application in C++. I'd
like it to run in Windows, OS X, PC-BSD and Linux. From my research, it
seems I should use Qt or Gtk as a graphical library. Do you agree? Do
you have other tips? How Cygwin could help me? Thanks.
It might be an idea to ask around the specific communities. For
example, ask the Mac communities of what they think of Qt/Gtk apps.

There's a few other ideas.

1) Just write your code in a clean style, using MVC and other good
practices, to make cross platform GUIs much simpler. Clear separation
of GUI and model, should really help. You can write "cross platform"
C++ classes whose behaviour works the same on all platforms. For
example:

class Button {
void Push();
FunctionPointer OnPush;
};

Then you can implement your button differnetly on different platforms.
On Win, you'll use a CButton, On Mac you'll add an NSButton* to the
class's definition, I guess you'll need to write the class's definition
different on different platforms. The point is, you make a simple
consistant API, that does only what you need and no more.

DON'T write a cross platform GUI library ;) Write a partially complete
but well planned out library that does only what your particular app
needs. Or else you'll spend your whole time doing work you'll never
use.

2) Write the app in C++, but the GUI in REALbasic. REALbasic does have
some issues with it's GUI components and does produce huge executables,
so it's best to avoid if you are doing large projects. REALbasic is
great for small projects, though, like little cross platform utilities.
For medium sized, it's so-so, you won't really gain or lose by using
it.

Most "good apps" tend to have the UI written natively for each
platform... something to keep in mind.

Dec 26 '06 #2

Charles napsal:
I'd like to develop a simple cross-platform application in C++. I'd
like it to run in Windows, OS X, PC-BSD and Linux. From my research, it
seems I should use Qt or Gtk as a graphical library. Do you agree? Do
you have other tips? How Cygwin could help me? Thanks.
You can use wxWidgets too. See http://www.wxwidgets.org

Dec 26 '06 #3

Charles wrote in message ...
>I'd like to develop a simple cross-platform application in C++. I'd
like it to run in Windows, OS X, PC-BSD and Linux. From my research, it
seems I should use Qt or Gtk as a graphical library. Do you agree? Do
you have other tips? How Cygwin could help me? Thanks.
[OT]

You might want to take a look at wxWidgets:
wxWidgets URL: http://www.wxwidgets.org

'Cygwin' is a full GCC port to windows. ('nix on windows)
'MinGW' is a Minimal GCC port to windows. (use Msys for 'nix)

GUI and non-standard libs are Off Topic for this NG.

--
Bob R
POVrookie
---
Dev-C++ IDE: http://www.bloodshed.net/ (with MinGW)
MinGW (GNU compiler): http://www.mingw.org/
MinGWStudio http://www.parinyasoft.com/
Dec 26 '06 #4
Ah cool, thanks, so from what I understand, I can write code for Unix
and compile it under Windows using Cygwin. Pretty neat. I'll look more
into it.

Dec 26 '06 #5

Ondra Holub wrote:
Charles napsal:
I'd like to develop a simple cross-platform application in C++. I'd
like it to run in Windows, OS X, PC-BSD and Linux. From my research, it
seems I should use Qt or Gtk as a graphical library. Do you agree? Do
you have other tips? How Cygwin could help me? Thanks.

You can use wxWidgets too. See http://www.wxwidgets.org
Looks pretty cool. I didn't know about this one!

Any examples lying around for me to see the resulting apps?

Dec 27 '06 #6

Charles wrote:
I'd like to develop a simple cross-platform application in C++. I'd
like it to run in Windows, OS X, PC-BSD and Linux. From my research, it
seems I should use Qt or Gtk as a graphical library. Do you agree? Do
you have other tips? How Cygwin could help me? Thanks.
No doubt about it, use QT. I've been using it since Version 2.0 and
nothing else I've tried even comes close. I use the commercial version
so I have database, socket and the like across all platforms. It's
really good. I've been programming since 1981. The best way in Windows
is Visual C++ and in Linux, I use KDevelop with GCC although it doesn't
matter, they give you all the source code and you use any platform you
like, Borland, Eclipse. You can download it free from
www.trolltech.com. I went to it because I develop OpenGL 3d programs
but it's 2d library is second to none.

Pierre

Dec 27 '06 #7

co**********@googlemail.com wrote in message ...
>
Ondra Holub wrote:
>You can use wxWidgets too. See http://www.wxwidgets.org

Looks pretty cool. I didn't know about this one!

Any examples lying around for me to see the resulting apps?
Go to the site, look around. Download the full source or specific platforms
source. Comes with sample/example programs to demonstrate the features.

Or, get the docs and read a little to see if it's what you want.

Further discussion discouraged, it's Off-Topic.
There is an wxWidgets NG.

--
Bob R
POVrookie
Dec 27 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
3
by: rollasoc | last post by:
Hi, Doing a bit of system testing on a Windows 98 laptop. (.Net 1.1 app). Did a bit of testing. Loaded a previously saved file. A gray box appeared with the text and buttons all white...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
23
by: Jeff Rodriguez | last post by:
Here's what I want do: Have a main daemon which starts up several threads in a Boss-Queue structure. From those threads, I want them all to sit and watch a queue. Once an entry goes into the...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
1
by: Rob Woodworth | last post by:
Hi, I'm having serious problems getting my report to work. I need to generate a timesheet report which will contain info for one employee between certain dates (one week's worth of dates). I...
6
by: Simon | last post by:
Hi All, An experiment i'm doing requires requires a synchronous cross-domain request, without using a proxy. I wondered if anyone had any ideas to help me achieve this. Below is what I have...
6
by: Bart Van der Donck | last post by:
Hello, I'm presenting my new library 'AJAX Cross Domain' - a javascript extension that allows to perform cross-domain AJAX requests. http://www.ajax-cross-domain.com/ Any comments or...
6
by: ampo | last post by:
Hello. Can anyone help with cross-domain problem? I have HTML page from server1 that send xmlHTTPRequest to server2. How can I do it? Thanks.
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.