www.digitalmars.com         C & C++   DMDScript  

D - templates in libraries causes missing stuff

if I try dmd main.d helpers.d it works
but if you run build.bat it fails

main.obj(main)
 Error 42: Symbol Undefined
_Dhelpers__L8Interface__0_cast_to_FPS8com_GUIDC6Obje
ctPPvZi

build.bat is ....
dmd -c helpers.d
lib mylib +-helpers.obj,,
dmd -c main.d
set LIB=c:\dmd\lib;c:\dm\lib
link main.obj,main,,mylib+phobos+snn+uuid/noi

I rely on this for my build env, as I have over 32 d files to include and I
started getting complains from dmd about cmd line length.
(and it allows me to share code between projects).



begin 666 helpers.d
M;6]D=6QE(&AE;'!E<G,[#0H-"FEM<&]R="!C;VT[#0H-"B\O97AT97)N*"!#
M("D 24E$($E)1%])4W1O<F%G93L-" T*+R\ 9&5B=6=G:6YG(&]N;'D-"FEM
M<&]R="!C+G-T9&EO.PT*#0HO+R!!(&9E=R!,.$YI9VAT($-/32!U=&EL($-L
M87-S97, 86YD(%1E;7!L871E<PT*96YU;2!,.$-/32![#0H)255N:VYO=VXL
M#0H)24-L87-S1F%C=&]R>2P-"GT-" T*=&5M<&QA=&4 3#A);G1E<F9A8V5"
M:6YD:6YG*"!,.$-/32!)(#H 3#A#3TTN255N:VYO=VX *2![#0H)86QI87, 
M24E$7TE5;FMN;W=N(&EF7VED.PT*"6%L:6%S($E5;FMN;W=N(&EF7W1Y<&4[
M#0H)86QI87, 255N:VYO=VX 3#A#;VU)1CL-"GT-" T*=&5M<&QA=&4 3#A)
M;G1E<F9A8V5":6YD:6YG*"!,.$-/32!)(#H 3#A#3TTN24-L87-S1F%C=&]R
M>2 I('L-" EA;&EA<R!,.$-/32Y)56YK;F]W;B!I9E]S=7!E<CL-" EA;&EA
M<R!)241?24-L87-S1F%C=&]R>2!I9E]I9#L-" EA;&EA<R!)0VQA<W-&86-T
M;W)Y(&EF7W1Y<&4[#0H)86QI87, :6YS=&%N8V4 3#A);G1E<F9A8V5":6YD
M:6YG*"!I9E]S=7!E<B I(&)I;F1I;F=?<W5P97([#0H):6YT97)F86-E($PX
M0V]M248 .B!B:6YD:6YG7W-U<&5R+DPX0V]M248L(&EF7W1Y<&4 >PT*"7T-
M"GT-" T*=&5M<&QA=&4 3#A);G1E<F9A8V4H($PX0T]-($D .B!,.$-/32Y)
M56YK;F]W;B I('L-" EA;&EA<R!I;G-T86YC92!,.$EN=&5R9F%C94)I;F1I
M;F<H($D *2!B:6YD:6YG.PT*"4A215-53%0 8V%S=%]T;R  1U5)1" J(')I
M:60L($]B:F5C="!O+"!V;VED("HJ('!P=B I('L-" D):68 *" J<FEI9" ]
M/2!)241?255N:VYO=VX *2![#0H)"0DJ<'!V(#T *&)I;F1I;F<N:69?='EP
M92EO.PT*"0D)<F5T=7)N(%-?3TL[#0H)"7T-" D)*G!P=B ](&YU;&P[#0H)
M"7)E='5R;B!%7TY/24Y415)&04-%.PT*"7T-" EA;&EA<R!)56YK;F]W;B!,
M.$-O;4EN=&5R9F%C93L-"GT-" T*=&5M<&QA=&4 3#A);G1E<F9A8V4H($PX
M0T]-($D *2![#0H)86QI87, :6YS=&%N8V4 3#A);G1E<F9A8V5":6YD:6YG
M*"!)("D 8FEN9&EN9SL-" E(4D5354Q4(&-A<W1?=&\H($=5240 *B!R:6ED
M+"!/8FIE8W0 ;RP =F]I9" J*B!P<'8 *2![#0H)"6EF("  *G)I:60 /3T 
M8FEN9&EN9RYI9E]I9" I('L-" D)"2IP<'8 /2 H8FEN9&EN9RYI9E]T>7!E
M*6\[#0H)"0ER971U<FX 4U]/2SL-" D)?0T*"0ER971U<FX :6YS=&%N8V4 
M3#A);G1E<F9A8V4H(&)I;F1I;F<N:69?<W5P97( *2YC87-T7W1O*"!R:6ED
M+"!O+"!P<'8 *3L-" E]#0H)86QI87, 8FEN9&EN9RY,.$-O;4E&($PX0V]M
M26YT97)F86-E.PT*?0T*#0IT96UP;&%T92!,.$EN=&5R9F%C92  3#A#3TT 
M23$L($PX0T]-($DR("D >PT*"6%L:6%S(&EN<W1A;F-E($PX26YT97)F86-E
M0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I9"HJ('!P=BD-" E[#0H)"7)E='5R;B!#86Y3=&]R86=E+F-A<W1?
M=&\H(')I:60L('1H:7,L('!P=B I.PT*"7T-"B  ("!(4D5354Q4($-R96%T
M94EN<W1A;F-E*$E5;FMN;W=N(%5N:T]U=&5R+"!)240J(')I:60L('9O:60J
M*B!P=D]B:F5C="D-" E[#0H)"7)E='5R;B!%7TY/5$E-4$P[#0H)?0T*("  
M($A215-53%0 3&]C:U-E<G9E<BA"3T],(&9,;V-K*0T*"7L-" D)<F5T=7)N
M($5?3D]424U03#L-" E]#0I]#0H-"FEN="!M86EN*"!C:&%R6UU;72!A<F=V
C("D-"GL-" ER971U<FX ,#L-"GT ("  ("\O#0H-" T*#0H`
`
end

begin 666 build.bat
M9&UD("UC(&AE;'!E<G,N9 T*;&EB(&UY;&EB("LM:&5L<&5R<RYO8FHL+ T*
M9&UD("UC(&UA:6XN9 T*<V5T($Q)0CUC.EQD;61<;&EB.V,Z7&1M7&QI8 T*
M;&EN:R!M86EN+F]B:BQM86EN+"QM>6QI8BMP:&]B;W,K<VYN*W5U:60O;F]I
"#0H`
`
end
Aug 02 2003