[Info-vax] Linking problem with multiply defined symbols, how to resolve?
hb
end.of at inter.net
Wed Sep 28 08:41:07 EDT 2022
On 9/28/22 9:33 AM, Richard Levitte wrote:
> I have this problem, that I want to build an app or a shareable image, which is linked with another shared library, but which also implements its own variant of symbols that are defined in that other shared library.
>
If this is a simplified example of what you want to do:
$ cre foo.c
foo() {}
foobar() {}
^Z
$ cc foo
$ link/share foo,tt:/opt
symbol_vector=(foo=proc,foobar=proc)
^Z
$
$ cre bar.c
extern foo();
foobar(){}
bar(){
foo();
foobar();
}
^Z
$ cc bar
$ link bar,tt:/opt/map=bar/cross/full
foo/share
^Z
%LINK-W-MULDEF, symbol FOOBAR multiply defined
in module BAR file DSA3:[DECUSERVE_USER]BAR.OBJ;3
$
then using a linker cluster and /selective will work for for you:
$ link/exe=bar/map=bar/cross/full tt:/opt
cluster=a,,,bar
foo/share/sel
^Z
$
In this example you get foobar resolved from bar.obj and foo from
foo.exe. And no, VMS does not support symbol pre-emption, whatever that is.
More information about the Info-vax
mailing list