T.R | Title | User | Personal Name | Date | Lines |
---|
3416.1 | how about this... | DECC::J_WARD | | Thu Jan 30 1997 09:40 | 12 |
|
Try using -Hf on the cxx compile line
and explicitly link in cxx_repository/*.o
on the ld line, i.e.:
cxx -I./template -Hf useit.cxx
ld -o useit.so -g0 -O1 -shared /usr/lib/cmplrs/cxx/_main.o ./cxx_repository/*.o
useit.o -lcxxstd -lcxx -lexc -lc
This is sort of the technique we use when
we need to create common instantiaton libraries.
|
3416.2 | | DECC::FOLTAN | | Thu Jan 30 1997 09:46 | 15 |
|
Here is a description of -Hf from the Using
Guide
� -Hf
This causes the driver to perform the prelink phase, en-
suring that both the source and template instantiations
are compiled. No executable is created and the object files
are not deleted. Do not use the -c option because that
prevents the compilation of the template instantiations.
|
3416.3 | oops, my fault | KZIN::HUDSON | That's what I think | Thu Jan 30 1997 09:47 | 30 |
| re: .0
Sorry; I've just re-read the release notes and found that this is possible.
Specifically, in case other people come across this, the way I got the
code in .0 to compile was:
% cxx -I./template -o useit.o -c useit.cxx
% cxx -v -call_shared -o useit.so useit.o
.
.
.
/usr/lib/cmplrs/cc/ld -o useit.so -L/usr/lib/cmplrs/cxx -rpath /usr/lib/cmplrs/c
xx -g0 -O1 -call_shared /usr/lib/cmplrs/cc/crt0.o /usr/lib/cmplrs/cxx/_main.o ./
cxx_repository/mytemplate__Ti.o useit.o -lcxxstd -lcxx -lexc -lots -lc
ld:
Unresolved:
main
.
.
.
(use the last "ld" line displayed but modify it to:)
% ld -o useit.so -L/usr/lib/cmplrs/cxx -rpath /usr/lib/cmplrs/cxx -g0 -O1 -share
d /usr/lib/cmplrs/cc/crt0.o /usr/lib/cmplrs/cxx/_main.o ./cxx_repository/mytempl
ate__Ti.o useit.o -lcxxstd -lcxx -lexc -lots -lc -expect_unresolved main
[Moderators, please feel free to delete this note/reply if you want...]
nick
|
3416.4 | | KZIN::HUDSON | That's what I think | Thu Jan 30 1997 09:48 | 8 |
| re: .1 .2
You got those in while I was typing .3
Thanks very much, I'll have a play with Hf, this could be more elegant
than the solution in .3 for my customer who has a much larger app.
nick
|