Thread overview
Another link question: how to allow re-definitions?
May 12, 2003
Luna Kid
May 13, 2003
Walter
May 13, 2003
Luna Kid
May 13, 2003
Luna Kid
May 13, 2003
Luna Kid
May 13, 2003
Walter
May 13, 2003
Walter
May 12, 2003
Can optlink allow linking a working executable, when
modules have conflicting definitions -- symbols having
the same name but associated with non-identical code,
resolved by e.g. some "first/last wins" logic, like
some other linkers do?

(Remember "poor man's polymorphism", e.g. for overriding default callback functions provided by a library...)

Cheers,
Lunatic Sz.


May 13, 2003
"Luna Kid" <lunakid@neuropolis.org> wrote in message news:b9p93i$30pi$1@digitaldaemon.com...
> Can optlink allow linking a working executable, when
> modules have conflicting definitions -- symbols having
> the same name but associated with non-identical code,
> resolved by e.g. some "first/last wins" logic, like
> some other linkers do?

I'm sorry, it does not. I don't know of any linker that has that.

> (Remember "poor man's polymorphism", e.g. for overriding default callback functions provided by a library...)

You must be thinking of how libraries are searched for unresolved symbols, in order. That works.


May 13, 2003
> > modules have conflicting definitions -- symbols having
> > the same name but associated with non-identical code,
> > resolved by e.g. some "first/last wins" logic, like
> > some other linkers do?
>
> I'm sorry, it does not. I don't know of any linker that has that.


LCCLNK was the last one I used this way. See below, please.


> > (Remember "poor man's polymorphism", e.g. for overriding default callback functions provided by a library...)
>
> You must be thinking of how libraries are searched for unresolved symbols, in order. That works.

Yes, that's part of the game. The question is how the duplicate definitions can be resolved in a scenario like this:

FRAMEWORK.LIB:

    _main
    _callback_one    ; default implementation
    _callback_two    ; default implementation
    ...

MYAPP.OBJ:

    _callback_one    ; custom implementation


So, how to correclty link this stuff with OPTLINK?

    link myapp.obj, myapp.exe,, framework.lib, app.def, app.res

does not seem to be enough.

I used to manage with the few compiler systems I tried, but that was some 5 years ago. But I know LCC works, for sure, as just tried it again:

    lcclnk -subsystem windows -o test.exe test.obj winmill.lib test.res

Of course, I get warnings:

    def_app.obj: multiple definition of _wm_configure
    first definition is in file test.obj
    def_app.obj: multiple definition of _wm_pre_loop
    first definition is in file test.obj
    def_app.obj: multiple definition of _wm_post_loop
    first definition is in file test.obj
    Time: 8.982 seconds

But the executable is created perfectly OK.

Thanks,
Sz.


May 13, 2003
Some more info...

windowed.def:
    EXETYPE NT
    SUBSYSTEM WINDOWS


link /nodel main.obj test.obj, test.exe,, winmill.lib gdi32.lib,
    windowed.def, test.res

OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

winmill.lib(def_app)  Offset 04702H Record Type 0091
 Error 1: Previous Definition Different : _wm_configure
winmill.lib(def_app)  Offset 04714H Record Type 0091
 Error 1: Previous Definition Different : _wm_pre_loop
winmill.lib(def_app)  Offset 04727H Record Type 0091
 Error 1: Previous Definition Different : _wm_post_loop

--- errorlevel 3

P:\win32_\WinMill\lib\v0.05-dmc>test.exe

...

So, the EXE is there. But it does not run: (see the attached box).

Now, is it possible that OPTLINK has already been doing
it for me, I just screw up the EXE type somehow? Or is
this failure indeed due to an incomplete link?

Thanks,
Sz.


begin 666 err.gif .dat
M1TE&.#EA@P*F`+,```4#!=V.@P<9D=Y3,'=M9+H&!^'.P],S'P1<[C.4_ 0.
M? 1!W+>KG>OJW.UI6IR^O"'Y! ``````+ ````"#`J8`0P3_$$BYJKTHZ\V[
M_V HCF1IGFBJKFSKOG LNPM7>S>8V]D^W\">$.'3?8+$(=*H0A9%2VBR0JQ=
MK)=)H2 04'<)31@QWA1SSN14K30+GVNV6XT>:GS+<Z?^YK.M(7!V;H* .'1O
M=W)_<8.$@3Q1CWR&B(EV091RAG6<C8I^@&E[EYN)GIYS:UBKK:*M<:FQ?;"S
MC+!IF6V,F:RZNJZ7P(8-#@P,`<G)#@',#L_0#@,#!PT570I>E0W<`AG<W=_A
MX@W>".#>X WDYNCGZ +J0^I=BAKPB*\W[NSJW?SOR@4L%P^<N(+MRHUSQP]@
MPW$!TW7KXG!A.(;A]G5[%5'-PRX%_[F%@!=2(L&2%$5&I*A `;M[$TV"?'BR
MWDHOC4A67(=/9\8VE819RF5IZ*Y1H_*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ZC,GXGJ&/]ZWV3NAM77JRU8/QP@K-8
MXC&>.(S?+9;HS0_>V#9X1B%>\8A37.0?'WG(DTM7;>@[X4]FM4I!.<VVG,[7
MQ5[YB?6\_^Z:;[;E);\JSEBHOWR17&L=S[F26;)A5^=%Z"9G.LB=SG.HHS5@
MT^;QZF;NCZ4_/>M1;SK7M=[HSJ2\UJ(><]$;^T>J&]C>9K^SRJ'&]LKNO,%K
MA_N1(W+I]'Y=[U[G^];]+M^0I?V^=-_[WPO?=</W'?%*I ?2ZP+6NF=WX]V]
M>N2K[';+.[BFC.)\YSW_>="'7O2C)WWI37]ZST\^\PEV,X.1N_C#QU[QLD]\
M[6$_>]S;GO:WUWWN;]\8S*]>^,,G/HW'SI=)%U_YRV][A)//?.A'?]#!EW[U
MK6]VZE]?^]N7M=B)O6#&<U_\X^=S]LE_?O1#V0`OG6OZW?_^(I;SY!640$7]
M6V%__-]?__GG__[]WW\`_#\!#$ "'$ #+$ $/$ %3$ &7$ ';$ (?$ )C$ *
MG$ +K$ ,O$ -S$ .W$ /[$ 0W,"*.($2*$$!,$$4/$$53$$67$$7;$$8?$$9
MC$$:G$$;K$$<O$$=S$$>W$$?[$$@_$$A#$(B'$(C+$(D/$(E3$(F7$(G;$(H
*?$(IC$(<C ``.P``
`
end

May 13, 2003
> So, the EXE is there. But it does not run: (see the attached box).

Dammit, sorry! (FAR Manager appends a space to the
filename on copy, that's why it won't open... :-/ )

Spammer Sz.



May 13, 2003
You can try what's called a "weak" extern.

"Luna Kid" <lunakid@neuropolis.org> wrote in message news:b9qhmq$14o3$1@digitaldaemon.com...
> > > modules have conflicting definitions -- symbols having
> > > the same name but associated with non-identical code,
> > > resolved by e.g. some "first/last wins" logic, like
> > > some other linkers do?
> >
> > I'm sorry, it does not. I don't know of any linker that has that.
>
>
> LCCLNK was the last one I used this way. See below, please.
>
>
> > > (Remember "poor man's polymorphism", e.g. for overriding default callback functions provided by a library...)
> >
> > You must be thinking of how libraries are searched for unresolved
symbols,
> > in order. That works.
>
> Yes, that's part of the game. The question is how the duplicate definitions can be resolved in a scenario like this:
>
> FRAMEWORK.LIB:
>
>     _main
>     _callback_one    ; default implementation
>     _callback_two    ; default implementation
>     ...
>
> MYAPP.OBJ:
>
>     _callback_one    ; custom implementation
>
>
> So, how to correclty link this stuff with OPTLINK?
>
>     link myapp.obj, myapp.exe,, framework.lib, app.def, app.res
>
> does not seem to be enough.
>
> I used to manage with the few compiler systems I tried, but that was some 5 years ago. But I know LCC works, for sure, as just tried it again:
>
>     lcclnk -subsystem windows -o test.exe test.obj winmill.lib test.res
>
> Of course, I get warnings:
>
>     def_app.obj: multiple definition of _wm_configure
>     first definition is in file test.obj
>     def_app.obj: multiple definition of _wm_pre_loop
>     first definition is in file test.obj
>     def_app.obj: multiple definition of _wm_post_loop
>     first definition is in file test.obj
>     Time: 8.982 seconds
>
> But the executable is created perfectly OK.
>
> Thanks,
> Sz.
>
>


May 13, 2003
Also, put your "default implementations" each in a separate .obj file, and put those .obj files in a library. Link that library last.

"Luna Kid" <lunakid@neuropolis.org> wrote in message news:b9qhmq$14o3$1@digitaldaemon.com...
> > > modules have conflicting definitions -- symbols having
> > > the same name but associated with non-identical code,
> > > resolved by e.g. some "first/last wins" logic, like
> > > some other linkers do?
> >
> > I'm sorry, it does not. I don't know of any linker that has that.
>
>
> LCCLNK was the last one I used this way. See below, please.
>
>
> > > (Remember "poor man's polymorphism", e.g. for overriding default callback functions provided by a library...)
> >
> > You must be thinking of how libraries are searched for unresolved
symbols,
> > in order. That works.
>
> Yes, that's part of the game. The question is how the duplicate definitions can be resolved in a scenario like this:
>
> FRAMEWORK.LIB:
>
>     _main
>     _callback_one    ; default implementation
>     _callback_two    ; default implementation
>     ...
>
> MYAPP.OBJ:
>
>     _callback_one    ; custom implementation
>
>
> So, how to correclty link this stuff with OPTLINK?
>
>     link myapp.obj, myapp.exe,, framework.lib, app.def, app.res
>
> does not seem to be enough.
>
> I used to manage with the few compiler systems I tried, but that was some 5 years ago. But I know LCC works, for sure, as just tried it again:
>
>     lcclnk -subsystem windows -o test.exe test.obj winmill.lib test.res
>
> Of course, I get warnings:
>
>     def_app.obj: multiple definition of _wm_configure
>     first definition is in file test.obj
>     def_app.obj: multiple definition of _wm_pre_loop
>     first definition is in file test.obj
>     def_app.obj: multiple definition of _wm_post_loop
>     first definition is in file test.obj
>     Time: 8.982 seconds
>
> But the executable is created perfectly OK.
>
> Thanks,
> Sz.
>
>