473,396 Members | 1,834 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,396 software developers and data experts.

portability issues

MJL
I am trying to figure out how to make my code as portable as possible.
I do not really use much of the STL. I could get by with a linked
list of strings. Microsoft does provide an object list and a string
list class but then I have to rewrite my code when using Borland or
other environments.

The other problem is GUIs. I know it is best to separate the
functional code from the visual interface code, but that still leaves
a lot of work to do when porting to another platform. Maybe the GUI
concept is over-rated and can be done away with for programs used in
the workplace that have to be functional but not pretty.

So to be most portable, I will write a linked list of strings class
and minimize use of GUI components. Any other ideas?

I am not going to:

1) Switch to Java.
2) Buy a library to supplement a deficient one.

Maybe it does pay to re-invent the wheel occasionally.
Jul 22 '05 #1
11 1509
MJL wrote:
I am trying to figure out how to make my code as portable as possible.
I do not really use much of the STL.
The STL is once of those things that is portable, you should use it.

I could get by with a linked list of strings. Microsoft does provide an object list and a string
list class but then I have to rewrite my code when using Borland or
other environments.
Not so if you use the std::string and std::list !

The other problem is GUIs. I know it is best to separate the
functional code from the visual interface code, but that still leaves
a lot of work to do when porting to another platform. Maybe the GUI
concept is over-rated and can be done away with for programs used in
the workplace that have to be functional but not pretty.
Take a look at some GUI libraries, e.g. wxwindows.

So to be most portable, I will write a linked list of strings class
and minimize use of GUI components. Any other ideas?

I am not going to:

1) Switch to Java.
2) Buy a library to supplement a deficient one.

Maybe it does pay to re-invent the wheel occasionally.


There are alot of copies of wheels out there.

Jul 22 '05 #2
MJL
ma**@affordablemedicalsoftware.com (MJL) wrote in message news:<29**************************@posting.google. com>...
I am trying to figure out how to make my code as portable as possible.
I do not really use much of the STL. I could get by with a linked
list of strings. Microsoft does provide an object list and a string
list class but then I have to rewrite my code when using Borland or
other environments.


Sorry for the confusion. In editing my post, I must have deleted the
first line or two by accident. One of my favorite platforms to write
for is Microsoft Pocket PC. I use Embedded Visual C++ because it is
free and I don't want to learn Visual Basic which is the other option
for PPC. The thing I really like about EVC++ is that I can compile an
executable that can be put on the device via infrared or memory card
and run without installation via a desktop PC.

The problem with Microsoft's EVC++ platform is that it does not
include the STL. Of course, the desktop version of VC++ and Borland's
C++ Builder and every other compiler do include it. This creates the
situation where if I use STL code in a desktop program, I have to
rewrite it for my Pocket PC version.

I agree that a better solution would be for microsoft to not leave out
important features of standard C++. I hope that other hand helds come
out with other, better OS's installed. A new apple Newton would be
ideal if they make it as close as possible to OS X.
Jul 22 '05 #3
On 8/2/2004 5:05 AM, MJL wrote:
I use Embedded Visual C++ because it is
free and I don't want to learn Visual Basic which is the other option
for PPC.
The third one is to use .NET CF and C# or VB .NET but
I don't recommend it for Pocket PC, simply C++ is the best.
Personaly, I don't like .NET ;-)
The problem with Microsoft's EVC++ platform is that it does not
include the STL.
Wrong ! SDK for Pocket PC 2002 does not include STL,
but SDK for Pocket PC 2003 does. Simply, install eVC++ 4.0.
I mainly use eVC++ 4.0 because it is better, more C++ standard
compliant and only the PPC 2003 is sell on the market, but
that's another story.

I use STL ported by Giuseppe Govi:

http://www.pocketpcdn.com/libraries/stl.html

It works great in eVC++ 3.0 and eVC++ 4.0 too.
I strongly recommend this port of STL.
This creates the
situation where if I use STL code in a desktop program, I have to
rewrite it for my Pocket PC version.


No, you don't have to rewrite it.
In my company, we developed GIS component (not COM/ActiveX) using
STL, and it compiles on desktop Windows and on UNIX/Linux
without any changes.

So, for better compliance with C++ standard I use
Entrek patch for RTTI and C++ exceptions handling.
I don't use Structured Exceptions Handling (SEH) at all.

Greets

--

Mateusz Łoskot
mateusz at loskot dot net
Jul 22 '05 #4
"MJL" <ma**@affordablemedicalsoftware.com> wrote in message
news:29**************************@posting.google.c om...
ma**@affordablemedicalsoftware.com (MJL) wrote in message

news:<29**************************@posting.google. com>...
I am trying to figure out how to make my code as portable as possible.
I do not really use much of the STL. I could get by with a linked
list of strings. Microsoft does provide an object list and a string
list class but then I have to rewrite my code when using Borland or
other environments.


Sorry for the confusion. In editing my post, I must have deleted the
first line or two by accident. One of my favorite platforms to write
for is Microsoft Pocket PC. I use Embedded Visual C++ because it is
free and I don't want to learn Visual Basic which is the other option
for PPC. The thing I really like about EVC++ is that I can compile an
executable that can be put on the device via infrared or memory card
and run without installation via a desktop PC.

The problem with Microsoft's EVC++ platform is that it does not
include the STL. Of course, the desktop version of VC++ and Borland's
C++ Builder and every other compiler do include it. This creates the
situation where if I use STL code in a desktop program, I have to
rewrite it for my Pocket PC version.

I agree that a better solution would be for microsoft to not leave out
important features of standard C++. I hope that other hand helds come
out with other, better OS's installed. A new apple Newton would be
ideal if they make it as close as possible to OS X.


Given your situation, you may want to consider creating or reusing some
STL-like foundation that you can use on both of your target platforms. If
the STL is not present on a platform that you wish to run your code, then
you might be able to write some containers and algorithms that are very
similar to the STL and use those instead. While those classes will probably
not be as robust as a full-fledged STL implementation, it's a reasonable
approach for maintaining portability. Another approach would be to use a
free, portable library, like STLPort. In the end, any of those approaches
may make porting easier, and they could also make your code more readable
for those that are familiar with the STL or your chosen library.

--
David Hilsee
Jul 22 '05 #5
ma**@affordablemedicalsoftware.com (MJL) wrote in message news:<29**************************@posting.google. com>...
I am trying to figure out how to make my code as portable as possible.
I do not really use much of the STL. I could get by with a linked
maybe you should ;) There's a lot to be gained by using STL:
vectors,lists,strings,etc. and most importantly: algorithms.
list of strings.
std::list<std::string> for instance.
Microsoft does provide an object list and a string
how do you want to be portable, if you use Microsoft's classes? ;)
list class but then I have to rewrite my code when using Borland or
other environments.

The other problem is GUIs. I know it is best to separate the
functional code from the visual interface code, but that still leaves
a lot of work to do when porting to another platform. Maybe the GUI
There are a lot of free cross-platform libraries out-there. But if you
need RAD, I don't think cross-platform is the way to go...
concept is over-rated and can be done away with for programs used in
the workplace that have to be functional but not pretty.
I'm not sure what you mean.
So to be most portable, I will write a linked list of strings class
and minimize use of GUI components. Any other ideas?


Again, you can use STL. And on top of it, use boost (www.boost.org) -
there are a lot of excellent libraries out there. I recommend
boost::function, boost::bind, boost::date_time, boost::filesystem,
boost::format, boost::smart_ptr to get you started.

Note that boost is ported across a lot of compilers.

Best,
John

John Torjo
Freelancer
-- jo**@torjo.com

Contributing editor, C/C++ Users Journal
-- "Win32 GUI Generics" -- generics & GUI do mix, after all
-- http://www.torjo.com/win32gui/

Professional Logging Solution for FREE
-- http://www.torjo.com/code/logging.zip (logging - C++)
-- http://www.torjo.com/logview/ (viewing/filtering - Win32)
-- http://www.torjo.com/logbreak/ (debugging - Win32)
(source code available)
Jul 22 '05 #6
The third one is to use .NET CF and C# or VB .NET but
I don't recommend it for Pocket PC, simply C++ is the best.
Personaly, I don't like .NET ;-)
Add me to that list, too.

The problem with Microsoft's EVC++ platform is that it does not
include the STL.


Wrong ! SDK for Pocket PC 2002 does not include STL,
but SDK for Pocket PC 2003 does. Simply, install eVC++ 4.0.
I mainly use eVC++ 4.0 because it is better, more C++ standard
compliant and only the PPC 2003 is sell on the market, but
that's another story.


I used the eVC++4.0 to compile for CE3.0 and PPC2000, but now I'm
using the GCC from:
http://mamaich.kasone.com/fr_pocket.htm
and it prodces way faster code than the MS compilers.
I use STL ported by Giuseppe Govi:

http://www.pocketpcdn.com/libraries/stl.html

It works great in eVC++ 3.0 and eVC++ 4.0 too.
I strongly recommend this port of STL.


There's a lot of free stl ports out there. I think they're all quite
good, since everyone is looking for benefits of the others and
implements it sooner or later.
This creates the
situation where if I use STL code in a desktop program, I have to
rewrite it for my Pocket PC version.


No, you don't have to rewrite it.
In my company, we developed GIS component (not COM/ActiveX) using
STL, and it compiles on desktop Windows and on UNIX/Linux
without any changes.


If you start your project with the will to port, it will not become
any problem. If, however, you already have a project based on e.g.
MFC, you're better off rewriting it completely.

-Gernot

Jul 22 '05 #7
MJL wrote:
I am trying to figure out how to make my code as portable as possible.

By sticking to ISO C++ code.
I do not really use much of the STL. I could get by with a linked
list of strings. Microsoft does provide an object list and a string
list class but then I have to rewrite my code when using Borland or
other environments.
Use the standard library instead.
The other problem is GUIs. I know it is best to separate the
functional code from the visual interface code,

ISO C++ code from system-specific code.

but that still leaves
a lot of work to do when porting to another platform. Maybe the GUI
concept is over-rated and can be done away with for programs used in
the workplace that have to be functional but not pretty.

GUIs differ from platform to platform where "platforms" here can even be
different APIs on the same system.
So to be most portable, I will write a linked list of strings class
and minimize use of GUI components. Any other ideas?

Use the standard library.


Regards,

Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 22 '05 #8
MJL wrote:
The problem with Microsoft's EVC++ platform is that it does not
include the STL.

Then EVC++ is lame.:-)
Of course, the desktop version of VC++ and Borland's
C++ Builder and every other compiler do include it. This creates the
situation where if I use STL code in a desktop program, I have to
rewrite it for my Pocket PC version.

Use some third party STL implementation like Boost or STLPort or other.
I agree that a better solution would be for microsoft to not leave out
important features of standard C++.

As far as I know in the upcoming VS development for mobile devices will
be supported (via the support of mobile .NET or how it is called). So
you will be able to use STL (and the rest of C++ standard library) with
that.

I hope that other hand helds come
out with other, better OS's installed. A new apple Newton would be
ideal if they make it as close as possible to OS X.

Well as far as I know there must be some GNU/Linux distributions out
there for your device. :-)


Regards,

Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 22 '05 #9
MJL wrote:

The problem with Microsoft's EVC++ platform is that it does not
include the STL. Of course, the desktop version of VC++ and Borland's
C++ Builder and every other compiler do include it. This creates the
situation where if I use STL code in a desktop program, I have to
rewrite it for my Pocket PC version.


Our library is available for EVC++. It's not free, however.

--

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Jul 22 '05 #10
On 8/2/2004 11:01 AM, Gernot Frisch wrote:
I mainly use eVC++ 4.0 because it is better, more C++ standard
compliant and only the PPC 2003 is sell on the market, but
that's another story.


I used the eVC++4.0 to compile for CE3.0 and PPC2000, but now I'm
using the GCC from:
http://mamaich.kasone.com/fr_pocket.htm
and it prodces way faster code than the MS compilers.


I have to check it.
Thanks for that info.
I use STL ported by Giuseppe Govi:

http://www.pocketpcdn.com/libraries/stl.html

It works great in eVC++ 3.0 and eVC++ 4.0 too.
I strongly recommend this port of STL.


There's a lot of free stl ports out there. I think they're all quite
good, since everyone is looking for benefits of the others and
implements it sooner or later.


Yes, I use Giuseppe's por because it is well working and
- as you can read on eVC++ forum http://www.pocketpcdn.com/forum/ - it
is very good and supports almost all STL features (no exceptions,
no streams).
No, you don't have to rewrite it.
In my company, we developed GIS component (not COM/ActiveX) using
STL, and it compiles on desktop Windows and on UNIX/Linux
without any changes.


If you start your project with the will to port,


Right, we started development with portability in mind.
All classes are implemented as OS independent,
but we had to implement some Facades and Adapters
for specific OS API like device context, etc.

Greets

--

Mateusz Łoskot
mateusz at loskot dot net
Jul 22 '05 #11
MJL
> > The problem with Microsoft's EVC++ platform is that it does not
include the STL.


Wrong ! SDK for Pocket PC 2002 does not include STL,
but SDK for Pocket PC 2003 does. Simply, install eVC++ 4.0.
I mainly use eVC++ 4.0 because it is better, more C++ standard
compliant and only the PPC 2003 is sell on the market, but
that's another story.


If this is true, than I apologize for bringing up a problem that has
been resolved because I am behind on updating my compiler. Thanks to
all for helpful responses.
Jul 22 '05 #12

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

Similar topics

7
by: fabio de francesco | last post by:
Hi, I'm not a professional programmer, but I've been writing C/C++ and Ada programs for a few years on GNU/Linux without ever concerning on standards and portability to other OSs. I've always...
21
by: asm | last post by:
Hi All, Like typdef, does C have further support for portability? Thanks, ASM
93
by: roman ziak | last post by:
I just read couple articles on this group and it keeps amazing me how the portability is used as strong argument for language cleanliness. In my opinion, porting the program (so you just take the...
1
by: William Ryan | last post by:
That's kind of a broad subject. As a seasoned C++/Java developer, maybe I could answer a little more specifically if I knew what sort of portability you meant. Do .NET apps port well within the...
23
by: OzBob | last post by:
I am developing some basic string / file manipulation C progams at home (Sparcstation running Solaris 9 and gcc) for my work environment (PA-RISC running HP-UX 11.11 and c99 compatible compiler)....
20
by: Jonathan Lamothe | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hey all. I'm trying to find a way to (portably) write 32-bit integer values to a file. As it stands, I've been using something like this: ...
10
by: Lionel B | last post by:
Greetings, I have some code that is to read unformatted data from disc and interpret it as blocks of unsigned integers. In an attempt to achieve efficiency (it is pretty essential for my...
18
by: jacob navia | last post by:
One of the holy cows here is this "portability" stuff. In practice, portability means: 1) Use the least common denominator of all the supported systems. 2) Between usability / good user...
2
by: DiAvOl | last post by:
Hello everyone, I read here and there that bit-field usage should be avoided because it's not portable. My question is why it's not portable? For example let's say I have a struct in my code...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.