When using the Dinkum libs, you should use <iostream.h>.
“Jeff Baker” <> jbaker@qnx.com> > wrote in message
news:afcidf$d7d$> 1@nntp.qnx.com> …
That is a list of shared object dependencies of your object. That tells
me
that it’s depending on the Dinkum C++ lib. Check that the source is
including <iostream.h>, not in all cases.
Oh, that’s a sweet command!!
Does that mean, those are libraries it relies on when linking into
other
binaries?
Or are those libraries it can’t find and still needs in order to be
complete?
got 4 ‘NEEDED’ items:
libxerces (which I also build and it seem to build Ok)
libcpp.so.2
libm.so.2
libc.so.2
“Jeff Baker” <> jbaker@qnx.com> > wrote in message
news:afcfht$ao8$> 1@nntp.qnx.com> …
How about an ‘objdump -x libxalan-c1_3.so | grep NEEDED’?
Jeff,
Here’s the latest: I added the -Bstatic to the link line for
building
libxalan-c1_3 and did a complete rebuild.
It builds and links cleanly, I get the .so like I should, and
always
have,
it was when I tried to link in that library
into another executable that the link errors would occur.
Here’s what I’ve discovered though, when I tried to link in that
just
built
library into a simple program, (like I
posted last time – hello world type with just a cerr and cout) I
get
undefined references in the libxalan-c1_3.so.
The commands and output are as follows:
#QCC -Vgcc_ntox86 -DX86_PC_NTO_QNX -L/opt/x/c/lib -lxalan-c1_3 -L/opt/xe/lib
-lxerces-c1_
6_0 -c testme.cpp
… looks good testme.o was created …
QCC -Vgcc_ntox86 -DX86_PC_NTO_QNX -L/opt/x/c/lib -lxalan-c1_3 -L/opt/xe/lib
-lxerces-c1_
6_0 testme.o -o testme 2> errors
more errors
/opt/x/c/lib/libxalan-c1_3.so: undefined reference to cerr' /opt/x/c/lib/libxalan-c1_3.so: undefined reference to
_Mutex::~_Mutex(void)’
/opt/x/c/lib/libxalan-c1_3.so: undefined reference to
_String_base::_Xlen(void) const' /opt/x/c/lib/libxalan-c1_3.so: undefined reference to
locale::_Init(void)’
/opt/x/c/lib/libxalan-c1_3.so: undefined reference to
ostrstream::~ostrstream(void)' /opt/x/c/lib/libxalan-c1_3.so: undefined reference to
_Locinfo::~_Locinfo(void)’
/opt/x/c/lib/libxalan-c1_3.so: undefined reference to
strstreambuf virtual table' /opt/x/c/lib/libxalan-c1_3.so: undefined reference to
locale:> > :_Id_cnt’
/opt/x/c/lib/libxalan-c1_3.so: undefined reference to
_Lockit::_Lockit(int)' /opt/x/c/lib/libxalan-c1_3.so: undefined reference to
ctype::id’
/opt/x/c/lib/libxalan-c1_3.so: undefined reference to ios_base type_info node' /opt/x/c/lib/libxalan-c1_3.so: undefined reference to
_Mutex::_Unlock(void)’
/opt/x/c/lib/libxalan-c1_3.so: undefined reference to
strstreambuf::_Init(int, char *, ch ar *, int)' /opt/x/c/lib/libxalan-c1_3.so: undefined reference to
ios_base::clear(_Iosb::_Iostat
e, bool)’
/opt/x/c/lib/libxalan-c1_3.so: undefined reference to
_Winit::~_Winit(void)' /opt/x/c/lib/libxalan-c1_3.so: undefined reference to
ostrstream::basic_ios<char, char_tr
aits > virtual table’
… and more… but I left them off as it’s more repeats of the
above…
I’m not sure if this helps or just confuses things?
Maybe this will give us some clue as to what’s happening?
It’s almost as if the libxalan-c1_3 isn’t really building
correctly,
but
I’m
not sure how to prove that
other than these undefined references.
BTW, the libxalan-c1_3 takes about 25 minutes to build.
Thanks for any more help you can provide… You’ve been very kind
so
far.
$Kevin
“Jeff Baker” <> jbaker@qnx.com> > wrote in message
news:afaec4$mqp$> 1@nntp.qnx.com> …
If you can compile a simple case then the problem must be
somewhere
in
the
compilation of your project. Have you tried a complete
recompile?
You
shouldn’t have to specify any system libraries manually.
QCC -DX86_PC_NTO_QNX -DNDEBUG -L/opt/x/c/lib -L/opt/xe/lib -lxerces-c1_6_0-O
-lxalan-c1_3 -c <input files
QCC -DX86_PC_NTO_QNX -DNDEBUG -L/opt/x/c/lib -L/opt/xe/lib -lxerces-c1_6_0-O
-lxalan-c1_3 -o <output file
That really should be all that’s required.
As an experiment, try adding ‘-Bstatic’ to the link line. Also,
can
you
post the output if you add ‘-Wl,–verbose | grep succeeded’ to
the
end
(the
very end) of the link line?
What’s strange is that I can create a very simple cpp program
and cout, cerr link in just fine.
#include <iostream
using namespace std;
int main()
{
cerr << “ouch!\n”;
cout << “bye!\n”;
return 0;
}
“Kevin Caporaso” <> kcaporaso@pillardata.com> > wrote in message
news:afac30$l73$> 1@nntp.qnx.com> …
Ya, I did that and I got the same linking errors.
Any other ideas?
eekk… I’m VERY new to QNX.
TIA,
$Kevin
“Jeff Baker” <> jbaker@qnx.com> > wrote in message
news:afaak4$jm8$> 1@nntp.qnx.com> …
Sorry, I don’t have a 6.1.0 install for reference here.
Lose
the -Y
option
completely and see what happens.
“Jeff Baker” <> jbaker@qnx.com> > wrote in message
news:afa0qj$bip$> 1@nntp.qnx.com> …
Try this:
QCC -Vgcc_ntox86 -Y_gpp -DX86_PC_NTO_QNX -L/opt/x/c/lib -lxalan-c1_3 -L/opt/
xe/lib -lxerces-c1_6_0-O -DNDEBUG
/opt/x/c/obj/TestXPath.o
/opt/x/c/obj/NodeNameTreeWalker.o -o
/opt/x/c/bin/testXPath
This bombs with:
cc: unknown target ‘gcc_ntox86_gpp’
cc: targets available in /etc/qcc:
gcc_ntox86 (GNU C, default)
make: *** [/opt/x/c/obj/XalanAttr.o] Error 1
I must be missing some definition or .conf file?? Where
do
i
find
the
correct one?
Thanks!
You should also be sure they your .o files have been
properly
compiled
as
well.
QCC -Vgcc_ntox86 -Y_gpp -c .c <.cc, *.cpp,
whatever,
+
all
the
other
libs
and defines you need
You shouldn’t have to specify -lc, or -lstdc++, the
qcc
conf
files
will
handle that.
If you want to use the Dinkum C++ libs instead of the
GNU
C++
libs
change -Y_gpp to -Y_cpp.
Kris,
I am seeing that linking problem with cout, cerr
again,
this
time,
with
QCC –
Here’s the compile line and a few of the linking
errors
follow:
There are others but I figured this was reasonable
sampling.
QCC -DX86_PC_NTO_QNX
-lc -L/opt/x/c/lib -lxalan-c1_3 -L/usr/lib -L/opt/xe/lib -lxerces-c1_6_0
-O
-DNDEBUG /o
pt/x/c/obj/TestXPath.o
/opt/x/c/obj/NodeNameTreeWalker.o -o
/opt/x/c/bin/testXPath
/opt/x/c/obj/TestXPath.o: In function main': /opt/x/c/obj/TestXPath.o(.text+0x5baf): undefined reference to
cout’
/opt/x/c/obj/TestXPath.o: In function
__static_initialization_and_destruction_0': /opt/x/c/obj/TestXPath.o(.text+0x5eca): undefined reference to
ios_base::Init::Init(void)
’
/opt/x/c/obj/TestXPath.o(.text+0x5eda): undefined
reference
to
_Winit::_Winit(void)' /opt/x/c/obj/TestXPath.o(.text+0x5eeb): undefined reference to
_Winit::~_Winit(void)’
/opt/x/c/obj/TestXPath.o(.text+0x5efd): undefined
reference
to
`ios_base::Init::~Init(void
)’
TIA,
$Kevin
“Kris Warkentin” <> kewarken@qnx.com> > wrote in message
news:af7ci1$911$> 1@nntp.qnx.com> …
How are you compiling? The normal way would be to
use
‘QCC’
(note
the
case)
or ‘qcc -lang-c++’ which should give you the
proper
linkage.
cheers,
Kris
“Kevin Caporaso” <> kcaporaso@pillardata.com> > wrote
in
message
news:af7af7$6vd$> 1@nntp.qnx.com> …
Hello,
I am pulling my hair out on this one…
I am getting undefined references to cerr, cout
and
other
ostream
type
calls.
I assumed they were always in libc and libstdc++
but
I’m
linking
against
those
libraries.
Which library contains cerr, cout under QNX 6.1
?
TIA,
$Kevin
\