Announcement: Standard C++ Library available

Hi all,

Those of you developing in C++ may be interested to hear that there is now an unsupported (by QSSL) Standard C++ library available for QNXRTP, which may be useful in keeping you going until the Dinkumware C++ libraries are released for QNXRTP.

The library is STLport, from www.stlport.org, and the version you need is the recently released 4.1 beta 4 (or later).

To get it up and running is simple. First of all you’ll need a version of g++ called c++:

su
ln -s /usr/bin/g++ /usr/bin/c++

Now, unpack the tar, change to the src directory, and type:

make -fgcc.mak

A few minutes later the compile should successfully complete.

Finally, you need to copy the contents of the libs dir to perhaps /usr/local/lib and the stlport include directory (called stlport) to /usr/local/include/stlport

To compile using the ISO C++ libraries, try:

g++ -I/usr/local/include/stlport -L/usr/local/lib -lstlport_gcc file.cpp

perhaps with the traditional test file:

#include

int main()
{
std::cout << “Hello world!” << std::endl;
}

Hope someone finds it useful, even in the diehard C coder QNX world (I am successfully using it in a commercial project). With it you should be able to compile almost all ISO C++ code (the g++ compiler is close to the ISO/ANSI C++ standard, and the STLport library is very close, although perhaps not as close as Dinkumware). This will be useful if you are trying to work through an up-to-date/good C++ text book such as “Accelerated C++” by Koenig and Moo.

Oh, and if it trashes your machine don’t blame me…

Tom

I compiled this and made it available through our Package repository if
anyone’s interested. If anyone
has any problems let me know. Just add http://www.nexwarecorp.com/repository
to your package manager
and the package should show up under Development.

Jerry Kirk

“tom” <the_wid@my-deja.com> wrote in message
news:Voyager.001213205920.48443444A@administrator.co.uk

Hi all,

Those of you developing in C++ may be interested to hear that there is now
an unsupported (by QSSL) Standard C++ library available for QNXRTP, which

may be useful in keeping you going until the Dinkumware C++ libraries are
released for QNXRTP.

The library is STLport, from > www.stlport.org> , and the version you need is
the recently released 4.1 beta 4 (or later).

To get it up and running is simple. First of all you’ll need a version of
g++ called c++:

su
ln -s /usr/bin/g++ /usr/bin/c++

Now, unpack the tar, change to the src directory, and type:

make -fgcc.mak

A few minutes later the compile should successfully complete.

Finally, you need to copy the contents of the libs dir to perhaps
/usr/local/lib and the stlport include directory (called stlport) to

/usr/local/include/stlport

To compile using the ISO C++ libraries, try:

g++ -I/usr/local/include/stlport -L/usr/local/lib -lstlport_gcc file.cpp

perhaps with the traditional test file:

#include <iostream

int main()
{
std::cout << “Hello world!” << std::endl;
}

Hope someone finds it useful, even in the diehard C coder QNX world (I am
successfully using it in a commercial project). With it you should be able

to compile almost all ISO C++ code (the g++ compiler is close to the
ISO/ANSI C++ standard, and the STLport library is very close, although
perhaps not as close as Dinkumware). This will be useful if you are trying
to work through an up-to-date/good C++ text book such as “Accelerated C++”
by Koenig and Moo.

Oh, and if it trashes your machine don’t blame me…

Tom

In article <Voyager.001213205920.48443444A@administrator.co.uk>, tom
<the_wid@my-deja.com> wrote:

To compile using the ISO C++ libraries, try:

g++ -I/usr/local/include/stlport -L/usr/local/lib -lstlport_gcc file.cpp

perhaps with the traditional test file:

#include <iostream

int main()
{
std::cout << “Hello world!” << std::endl;
}

Here’s a completely ignorant question: What advantage does STLport have
over the STL implementation which already comes with the gcc tools for
Neutrino? I have noticed that gcc STL is (ahem) a bit behind the ANSI
standard, so I am guessing that better compliance is a feature. Are
there others.

Also, as a data point, I notice that the above test application
generates a 5k executable when compiled and linked with the gcc STL:

qcc -o Test Test.cpp

The same program generates a 30k executable when compiled and liked with
STLport:

qcc -I/usr/local/include/stlport -L/usr/local/lib
-lstlport_gcc -o Test.stlport Test.cpp

Both executables are linking against shared libraries, so it’s not an
issue of one hard-linking and the other soft-linking. Has anyone else
noticed that size differences and/or have an idea why they are so
radically different?