www.digitalmars.com         C & C++   DMDScript  

c++ - Another link question: how to allow re-definitions?

reply "Luna Kid" <lunakid neuropolis.org> writes:
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 12 2003
parent reply "Walter" <walter digitalmars.com> writes:
"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 12 2003
parent reply "Luna Kid" <lunakid neuropolis.org> writes:
 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
next sibling parent reply "Luna Kid" <lunakid neuropolis.org> writes:
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

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


MPW$!TW7KXG!A.(;A]G5[%5'-PRX%_[F% !=2(L&2%$5&I*A `;M[$TV"?'BR

MW[2O!ZA5LR!  04Q9$".";,6`< -8=22<2N 3+VV;^G6G2LW`<BW9?S^_<MV

M,.+-IU>CAOU7L :YK/D2)IT;-FG1< <;3JV9<NK3>3N/ILV8=QD/SU<TYOUA
M>HGH<*F#P

M?BBB?A[25^*(**;(WP)=:*3BB_.=F**,,'9H'XTD(HAC #O6Z""'/ 89HY!$

M=GFAFEJF:2.15HK(9ICT0>DBA >$%8TT>19P )]Y!BKH`?CU:.&68E+9YIHO
MSHEHHXLF^F6!D3)I)IR4MCDAC"4Z6NF(=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P<[-T 

M^,5,.HR"6=3 '06X,O%!#WE
MRSF&$H^NC&(?&0A"7/+N=]LK935MV4SP6"0UB$K<-1[I+L6AKP``&( 1)60R
M\_52/>E<9[72435VQI,L\E3G/4!6K-!X$E/;TA<][^5/MP"TG;\1:$$10L/*
M"51&___8X4B^V3B(RHL`Y 2<4/2YFXM61F/NT>=5KF10 NKCGO/<"[;XA$^[

M:Z)? E6T3--4,3U5JDZE:E2K"E6L3M6J6\UJRUZ$'R4&-5;\' U7M=I5LU[U
MK&M5:UO3^E:TQE6K5N-6.OXSIG,8( "3HB0Y&44DL096L.YTJUP+RU:XELRG



M;WN9R][WNA= D-T68\6K%? V-[_[E2]_X_M?_8:&J-;RZ7T-[-D#EU6HF$UP

M7;SB%[=84P89\'F?<^+*#C
M_&0H2]>K4:8R.&K<XRK_E+Y95C"7&VRCH468P$ FLI>!BF7.9LO,]_W2AH6V



M?K*>-RFC[/PL$5AC\EO+9C2TG<UM97];W-XF=[<[35V+' I<90;V8Z5X;84$
M+8X)0W.VR=QN'Q\:WU3&M;EYZ\"?M:ZC,GXGJ&/]ZWV3NAM77JRU8/QP K-8

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]\



MG$ +K$ ,O$ -S$ .W$ /[$ 0W,"*.($2*$$!,$$4/$$53$$67$$7;$$8?$$9

*?$(IC$(<C ``.P``
`
end
May 13 2003
parent "Luna Kid" <lunakid neuropolis.org> writes:
 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. begin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QP K-8 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]\ MG$ +K$ ,O$ -S$ .W$ /[$ 0W,"*.($2*$$!,$$4/$$53$$67$$7;$$8?$$9 *?$(IC$(<C ``.P`` ` end
May 13 2003
prev sibling next sibling parent "Walter" <walter digitalmars.com> writes:
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
prev sibling parent "Walter" <walter digitalmars.com> writes:
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.
May 13 2003