Where is iostream?

Hi folks,

I’ve got a silly and probably dump question. What library do I have to link
with to pull in iostream stuff?

If I’ve got a hello.cpp which uses streams and compile/link in one step, all
is well:

qcc -V gcc_ntox86 hello.cpp # OK!

But, if I’m using a makefile which seperates the compiles and links in
separate steps, the linker can’t find any of my iostream references.

qcc -c -V gcc_ntox86 hello.cpp -o hello.o # OK!
qcc -V gcc_ntox86 hello.o -o hello # Lots of errors

I’m sure there’s something simple I’m supposed to do, but I haven’t figured
out. And I’d really like to know where this is documented. I would think
others would like to know also!

Thanks in advance,
–Todd
todd_hitt@yahoo.com

Ah, you’ll be needing to link in the libstdc++.so library - its in /usr/lib
and you can do it by adding -l/usr/lib/libstdc++.so to the line where you
link your objects together.

Um, dunno where its documented though…

In comp.os.qnx Jim Atkins <jamesa@tsd.serco.com> wrote:
: Ah, you’ll be needing to link in the libstdc++.so library - its in /usr/lib
: and you can do it by adding -l/usr/lib/libstdc++.so to the line where you
: link your objects together.

: Um, dunno where its documented though…

Fairly standard practice if you need more than just very
rudimentary parts of CPP -lstdc++ should be enough
since it should already be in your LD_LIBRARY_PATH.

Thomas

Thomas (toe-mah) Fletcher QNX Software Systems
thomasf@qnx.com Neutrino Development Group
(613)-591-0931 http://www.qnx.com/~thomasf

Or you could just use qcc -lang-c++ or QCC on your link line - then
C++ exceptions would work too! ;v)

In comp.os.qnx Thomas Fletcher <thomasf@qnx.com> wrote:

In comp.os.qnx Jim Atkins <> jamesa@tsd.serco.com> > wrote:
: Ah, you’ll be needing to link in the libstdc++.so library - its in /usr/lib
: and you can do it by adding -l/usr/lib/libstdc++.so to the line where you
: link your objects together.

: Um, dunno where its documented though…

Fairly standard practice if you need more than just very
rudimentary parts of CPP -lstdc++ should be enough
since it should already be in your LD_LIBRARY_PATH.

Thomas

Thomas (toe-mah) Fletcher QNX Software Systems
thomasf@qnx.com > Neutrino Development Group
(613)-591-0931 > http://www.qnx.com/~thomasf


cburgess@qnx.com

I have just added this issue to the Knowlege Base at http://qnd.qnx.com.
You can find the solution to this issue, by searching on “iostream”.
You’ll also find the answer at the following link:

http://support.qnx.com/support/bok/solution.qnx?10136

Best Regards,

Marcin


In qdn.public.qnxrtp.devtools Colin Burgess <cburgess@qnx.com> wrote:

Or you could just use qcc -lang-c++ or QCC on your link line - then
C++ exceptions would work too! ;v)

In comp.os.qnx Thomas Fletcher <> thomasf@qnx.com> > wrote:
In comp.os.qnx Jim Atkins <> jamesa@tsd.serco.com> > wrote:
: Ah, you’ll be needing to link in the libstdc++.so library - its in /usr/lib
: and you can do it by adding -l/usr/lib/libstdc++.so to the line where you
: link your objects together.

: Um, dunno where its documented though…

Fairly standard practice if you need more than just very
rudimentary parts of CPP -lstdc++ should be enough
since it should already be in your LD_LIBRARY_PATH.

Thomas

Thomas (toe-mah) Fletcher QNX Software Systems
thomasf@qnx.com > Neutrino Development Group
(613)-591-0931 > http://www.qnx.com/~thomasf


cburgess@qnx.com

Marcin Dzieciol
Technical Support
QNX Software Systems Ltd.
Email: <marcind@qnx.com>