473,471 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Advice on writing portable C++ application

My goal is to write a studio-type application which will initially run
on Windows, but I would like it to run on other platforms with minimum
efforts.

I have made the decision to go with C++.

Through advice obtained in this NG (thanks!) I was able to determine
the available alternatives on the most obvious component that must be
portable, i.e. the GUI library. I still have to decide among the 3 big
ones (they are 3, right?).

But my question is about non GUI stuff: what else should I do to
achieve portability? Let's say I want to open a file. I don't want to
use the Windows specific system calls, but to use something like
'fopen()'. What non-GUI libraries or programming environments are
recommended?

TIA,

-Ramon

Nov 27 '07 #1
13 1759
Ramon F Herrera wrote:
My goal is to write a studio-type application
What's a "studio-type application"? Similar to Visual _Studio_?
which will initially run
on Windows, but I would like it to run on other platforms with minimum
efforts.

I have made the decision to go with C++.

Through advice obtained in this NG (thanks!) I was able to determine
the available alternatives on the most obvious component that must be
portable, i.e. the GUI library. I still have to decide among the 3 big
ones (they are 3, right?).

But my question is about non GUI stuff: what else should I do to
achieve portability? Let's say I want to open a file. I don't want to
use the Windows specific system calls, but to use something like
'fopen()'. What non-GUI libraries or programming environments are
recommended?
Usually the libraries designed to be portable contain some non-GUI
stuff. For example, Qt has threads, timers, strings, etc. It even
has some support for directory enumeration and file path management
as I recall. RTM (or Google) for more.

If you can't find (or decide not to use) a library that provides
those things, you could write your own or look on the Web for the
alternatives. For all I know they do exist, and probably plenty
of them. The main problem for you is that they are not really
topical since they don't support _all_ platforms where C++ exists
and hence you should try asking in the newsgroup dedicated to the
OS you're going to target.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Nov 27 '07 #2
On 2007-11-27 18:07:44 -0500, Ramon F Herrera <ra***@conexus.netsaid:
My goal is to write a studio-type application which will initially run
on Windows, but I would like it to run on other platforms with minimum
efforts.

I have made the decision to go with C++.
Why are you not considering java? They seem to have API's that have
implementations on each of the "3 big ones," including graphics and
file systems which you need.
>
Through advice obtained in this NG (thanks!) I was able to determine
the available alternatives on the most obvious component that must be
portable, i.e. the GUI library. I still have to decide among the 3 big
ones (they are 3, right?).

But my question is about non GUI stuff: what else should I do to
achieve portability? Let's say I want to open a file. I don't want to
use the Windows specific system calls, but to use something like
'fopen()'. What non-GUI libraries or programming environments are
recommended?

TIA,

-Ramon
--

-kira

Nov 27 '07 #3
On Nov 27, 7:26 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Ramon F Herrera wrote:
My goal is to write a studio-type application

What's a "studio-type application"? Similar to Visual _Studio_?
Going back to the earliest studio-type apps, mine is something similar
in look to MacPaint/MacDraw. You have a palette, you pick components
and you drag them around a canvas. You have a rectangular selection
tool, resizing, moving, that kind of stuff.

Nothing to do with compiling.

-Ramon

Nov 27 '07 #4
On Nov 27, 7:26 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Ramon F Herrera wrote:
My goal is to write a studio-type application

What's a "studio-type application"? Similar to Visual _Studio_?
which will initially run
on Windows, but I would like it to run on other platforms with minimum
efforts.
I have made the decision to go with C++.
Through advice obtained in this NG (thanks!) I was able to determine
the available alternatives on the most obvious component that must be
portable, i.e. the GUI library. I still have to decide among the 3 big
ones (they are 3, right?).
But my question is about non GUI stuff: what else should I do to
achieve portability? Let's say I want to open a file. I don't want to
use the Windows specific system calls, but to use something like
'fopen()'. What non-GUI libraries or programming environments are
recommended?

Usually the libraries designed to be portable contain some non-GUI
stuff. For example, Qt has threads, timers, strings, etc. It even
has some support for directory enumeration and file path management
as I recall. RTM (or Google) for more.
The main problem for you is that they are not really
topical since they don't support _all_ platforms where C++ exists
and hence you should try asking in the newsgroup dedicated to the
OS you're going to target.
In practical, realistic terms, the platforms I care about are Windows,
Linux and Mac.

-Ramon

Nov 27 '07 #5
On Nov 27, 7:36 pm, Kira Yamato <kira...@earthlink.netwrote:
On 2007-11-27 18:07:44 -0500, Ramon F Herrera <ra...@conexus.netsaid:
My goal is to write a studio-type application which will initially run
on Windows, but I would like it to run on other platforms with minimum
efforts.
I have made the decision to go with C++.

Why are you not considering java? They seem to have API's that have
implementations on each of the "3 big ones," including graphics and
file systems which you need.
Guess what, Kira... I do have Java version of the program, whose staus
is somewhere between a prototype and a working application. There are
a couple of factors for the C++ decision:

- I love Java, but I hate its non-compiled nature sometimes.
- I am itching for a reason to pick up C++ in a non-trivial project.
- Some of the libraries that I need are available in native only and
I don't find the JNI particularly appealing.

As you can see some of my reasoning is based on feelings (except for
the speed, that one is demonstrably objective).

-Ramon

Nov 27 '07 #6
Ramon F Herrera wrote:
[..]
In practical, realistic terms, the platforms I care about are Windows,
Linux and Mac.
As Alf mentions, Boost is one library you could certainly make use of.
Look in the archives, there used to be the "list of available libraries
FAQ" posted here by Nikki Locke. Peruse it to see what else is there.
I am certain you can find [almost] anything you need that has already
been designed, debugged (to some extend), and packaged in an easy to
use form (relatively speaking, of course).

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Nov 28 '07 #7
Ramon F Herrera wrote:
My goal is to write a studio-type application which will initially run
on Windows, but I would like it to run on other platforms with minimum
efforts.

I have made the decision to go with C++.

Through advice obtained in this NG (thanks!) I was able to determine
the available alternatives on the most obvious component that must be
portable, i.e. the GUI library. I still have to decide among the 3 big
ones (they are 3, right?).

But my question is about non GUI stuff: what else should I do to
achieve portability? Let's say I want to open a file. I don't want to
use the Windows specific system calls, but to use something like
'fopen()'. What non-GUI libraries or programming environments are
recommended?
The ones that come with your GUI library, the most of them put a layer
above the OS functionality (QFile,wxFile etc..), because they need it
anyway to achieve portability. Also, mixing, say, let's say a thread
layer library X with a high level GUI Y library usually doesn't work to
well (you end with a system where X-threads use X-mutexe and can not
synchronize with Y-threads, because they use Y-semaphores and so on)

Nov 28 '07 #8
On Nov 27, 7:45 pm, "Alf P. Steinbach" <al...@start.nowrote:
Through advice obtained in this NG (thanks!) I was able to determine
the available alternatives on the most obvious component that must be
portable, i.e. the GUI library. I still have to decide among the 3 big
ones (they are 3, right?).

A bunch.
I recently did some looking around and these are ones that have made
an impact:

http://www.wxwidgets.org/
http://www.gtk.org/
http://trolltech.com/

The GIMP toolkit didn't give me a good initial impression: how can a
*graphical* toolkit have such a clumsy looking web page? (typical of a
lot of GNU stuff).

The last one, Qt, has commercial leanings but they seem to be changing
their ways, adapting to a changing world. It is preferred by Google,
HP, etc.

Those are the 3 big ones I was talking about. Any other contenders?

-Ramon

Nov 28 '07 #9
Ramon F Herrera wrote:
>
But my question is about non GUI stuff: what else should I do to
achieve portability? Let's say I want to open a file. I don't want to
use the Windows specific system calls, but to use something like
'fopen()'. What non-GUI libraries or programming environments are
recommended?
What's wrong with the standard library, in this case, iostreams?

--
Ian Collins.
Nov 28 '07 #10
Ian Collins wrote:
Ramon F Herrera wrote:
>But my question is about non GUI stuff: what else should I do to
achieve portability? Let's say I want to open a file. I don't want to
use the Windows specific system calls, but to use something like
'fopen()'. What non-GUI libraries or programming environments are
recommended?
What's wrong with the standard library, in this case, iostreams?
the iostreams library avoids a couple of mainstream concepts for the
sake of total portability, for example "filename separators", "filename
character sets","directories","volumes","URL".

The GUI libraries OTOH emerged when iostreams & the standard library
weren't available in their final form and so they developed their own,
tightly coupled solutions for IO. They cover a much larger set of
platform dependent features, are integrated into the toolkit framework
(=exceptions, toolkit string classes) and are also more complete (like:
I can open a stream from ftp and use this to load an image).

With iostreams alone, I wouldn't even know where and how to store the
user's settings.
Nov 28 '07 #11
Marco Manfredini wrote:
Ian Collins wrote:
>Ramon F Herrera wrote:
>>But my question is about non GUI stuff: what else should I do to
achieve portability? Let's say I want to open a file. I don't want to
use the Windows specific system calls, but to use something like
'fopen()'. What non-GUI libraries or programming environments are
recommended?
What's wrong with the standard library, in this case, iostreams?

the iostreams library avoids a couple of mainstream concepts for the
sake of total portability, for example "filename separators", "filename
character sets","directories","volumes","URL".

The GUI libraries OTOH emerged when iostreams & the standard library
weren't available in their final form and so they developed their own,
tightly coupled solutions for IO. They cover a much larger set of
platform dependent features, are integrated into the toolkit framework
(=exceptions, toolkit string classes) and are also more complete (like:
I can open a stream from ftp and use this to load an image).

With iostreams alone, I wouldn't even know where and how to store the
user's settings.
Fair point.

--
Ian Collins.
Nov 28 '07 #12
Alf P. Steinbach wrote:
Poco <url: http://pocoproject.org/>.
Hm, interesting. I haven't noticed it before. Have you actively used it?
lg,
Michael
Nov 28 '07 #13
Ramon F Herrera wrote:
The GIMP toolkit didn't give me a good initial impression: how can a
*graphical* toolkit have such a clumsy looking web page? (typical of a
lot of GNU stuff).
Because it's by programmers, for programmers, who don't care about such
petty details.

However, I recommend wxWidgets. It's quite mature, complete and free. It
sits upon the/a native toolkit (and doesn't try to mimick it, like Qt),
although you can also create your own portable widgets of some sorts.
Nov 28 '07 #14

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

Similar topics

9
by: TPJ | last post by:
First I have to admit that my English isn't good enough. I'm still studying and sometimes I just can't express what I want to express. A few weeks ago I've written 'Python Builder' - a bash...
10
by: Beach Potato | last post by:
Dear Y'all: I'm about to start porting a big old project written in anscient version of Delphi to something more stable, robust, supportable and maybe even portable. Since I haven't seriously...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like...
10
by: Jason Curl | last post by:
Dear C group, I'm very interested in writing portable C, but I only have GNU, Sparc and Cygwin to compile on. What I find is the biggest problem to writing portable C is what headers to...
6
by: Abubakar | last post by:
Hi, we are finding out ways in which we could develop libraries that could be written in c++ in a way that we can use them in windows, linux, and mac os. We want to write portable code, so that it...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
12
by: Pepper | last post by:
I may be alone in this feeling, but I am a long time asp developer and after a few years of asp.net development still am not comfortable with the new way of doing things. Asp.net just seems too...
232
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
7
by: SM | last post by:
Hello, I have a index.php template (2 columns). The right columns contains a bunch of links (interviews, poems, etc...) The left columns contains the actual article. So if I click on a link on...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.