473,508 Members | 2,267 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2616

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
2033
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
3842
by: * ProteanThread * | last post by:
but depends upon the clique: ...
3
3071
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
1860
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
6480
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
2038
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
2746
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
8598
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
5458
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
3966
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
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.