473,806 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1546
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**@affordable medicalsoftware .com (MJL) wrote in message news:<29******* *************** ****@posting.go ogle.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**@affordabl emedicalsoftwar e.com> wrote in message
news:29******** *************** ***@posting.goo gle.com...
ma**@affordable medicalsoftware .com (MJL) wrote in message

news:<29******* *************** ****@posting.go ogle.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**@affordable medicalsoftware .com (MJL) wrote in message news:<29******* *************** ****@posting.go ogle.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,s trings,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_tim e, boost::filesyst em,
boost::format, boost::smart_pt r 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

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

Similar topics

7
1623
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 noted that when I write code I must use lots of platform specific system calls (POSIX and X/OPEN). Often I found myself using threads and concurrent processes with some sort of IPC. Some time I need some socket API. When I just want to open a...
21
1931
by: asm | last post by:
Hi All, Like typdef, does C have further support for portability? Thanks, ASM
93
3690
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 source code and recompile) is a myth started 20-30 years ago when world consisted of UNIX systems. Well, world does not consist of UNIX systems anymore, but there are 100s of different systems running in cell-phones, DVD players, game consoles...
1
1347
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 Windows OS? Well, as long as you have Win 98 or above, the short answer is yes. However, if users don't keep up to date on service packs.......... a different story. I have Mono loaded and it ROCKS. But there are
23
1948
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). However I seem to have encountered problems performing the most basic of manipulations and comparisons. I have posted my test code below, and the results I get on each compiler. The crux of the matter is that the 'strstr' function differs wildly...
20
4883
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: #include <stdio.h>
10
3827
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 application that the code be speed optimized ) I use reinterpret_cast to alias a block of chars read in from disc as a block of integer "words". My existing code (see simplified code below) appears to work well enough on the platforms available to me,...
18
409
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 experience and portability always choose portability since this minimizes programming effort
2
5959
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 with bit-fields like the following: struct bitfield_t { unsigned int val1 : 1; unsigned int val2 : 3;
0
9719
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10623
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10373
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9192
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6877
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3852
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.