www.digitalmars.com         C & C++   DMDScript  

D - not using phobos

reply "Carlos Santander B." <carlos8294 msn.com> writes:
If I have a different implementation of a phobos function (getch) inside a
.lib file, but I have neither the .obj nor the source code, how can I use
this function instead of that in phobos? dmd just seems to ignore it. I
tried compiling and linking in different stages, but it didn't work either.
Probably getch is part of the C RTL instead of phobos. Anyway, how can I use
a different one?

-------------------------
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 2003-06-18
Jun 24 2003
next sibling parent Helmut Leitner <leitner hls.via.at> writes:
"Carlos Santander B." wrote:
 
 If I have a different implementation of a phobos function (getch) inside a
 .lib file, but I have neither the .obj nor the source code, how can I use
 this function instead of that in phobos? dmd just seems to ignore it. I
 tried compiling and linking in different stages, but it didn't work either.
 Probably getch is part of the C RTL instead of phobos. Anyway, how can I use
 a different one?
I can only assume that you talk about two functions that look for the linker like two C functions in different .obj modules of different libraries. I think there is no way to resolve this. The linker will take the first getch he finds. This may depend on the order the libraries are searched. If the getch is bundled with other functions, it may be drawn in depending on their usage. When the first getch() is found and included, the linker will typically look further. Some linker may warn about "duplicate symbols" while others won't. -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Jun 24 2003
prev sibling next sibling parent "Walter" <walter digitalmars.com> writes:
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:bdb13k$pbm$1 digitaldaemon.com...
 If I have a different implementation of a phobos function (getch) inside a
 .lib file, but I have neither the .obj nor the source code, how can I use
 this function instead of that in phobos? dmd just seems to ignore it. I
 tried compiling and linking in different stages, but it didn't work
either.
 Probably getch is part of the C RTL instead of phobos. Anyway, how can I
use
 a different one?
Link your different one in first.
Jun 24 2003
prev sibling parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
I could get the .obj and then .asm of that getch function. Now, I don't know
anything about assembler, so can somebody explain how I can make this work
with DMD? (getch.asm generated by obj2asm attached)

—————————————————————————
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 2003-06-25


begin 666 getch.asm
M7T1!5$$)<V5G;65N="!P87)A('5S93,R('!U8FQI8R G1$%402<).W-I>F4 


M;W5P"0T*"65X=')N"5]?9V5T8V -" EE>'1R; E?7VEM<%]?4F5A9$-O;G-O
M;&5);G!U=$% ,38-" EE>'1R; E?7VEM<%]?4V5T0V]N<V]L94UO9&5 . T*


M97AT<FX)7U]P=71C: T*"65X=')N"5]?:6UP7U]0965K0V]N<V]L94EN<'5T
M04 Q- T*"65X=')N"5]?:6UP7U]'971.=6UB97)/9D-O;G-O;&5);G!U=$5V

















































































































M<PT*7U]G971C: EC;VUD870-" EA<W-U;64)0U,Z7U]G971C: T*"0EP=7-H




M;W8)14%8+%]?8V]N:6YP9F -" D)8VUP"45!6"Q%0U -" D):FYE"4PR00T*



M+"TX6T5"4%T-" D)<'5S: E%1$D-" D)<'5S: E%05 -" D)<'5S: ED=V]R
M9"!P='( 7U]C;VYI;G!F: T*"0EC86QL"61W;W)D('!T<B!?7VEM<%]?1V5T





M<F0 <'1R(%]?8V]N:6YP9F -"DPV1#H


M0PT*"0EC;7 )9'=O<F0 <'1R("TP,3AH6T5"4%TL, T*"0EJ90E,.4,-" D)
M;6]V>G )141)+&)Y=&4 <'1R("TP16A;14)070T*"0ET97-T"45$22Q%1$D-
M" D):FYE"4Q"1 T*"0EL96$)14%8+"TP,3AH6T5"4%T-" D)<'5S: E%05 -
M" D)8V%L; EN96%R('!T<B!?7V=E=&5X=&5N9&5D:V5Y8V]D90T*"0ET97-T


M"7!U<V ),0T*"0EP=7-H"45!6 T*"0EP=7-H"61W;W)D('!T<B!?7V-O;FEN




M4%T-" D)<'5S: ED=V]R9"!P='( 7U]C;VYI;G!F: T*"0EC86QL"45"6 T*

M6 T*"0EL96%V90T*"0ER970-"E]?9V5T8V )96YD<PT*7U]G971C:&4)8V]M


M"6IE"4PQ-PT*"0EO< ED=V]R9"!P='( 1DQ!5#I?1$%405LP,S0P:%TL,$9&

M-SH)"6-A;&P);F5A<B!P='( 7U]G971C: T*"0EM;W8)15-)+$5!6 T*"0EC








M: T*"0EM;W8)1DQ!5#I






M"6-M< E;15-)72Q$6 T*"0EJ90E,,S$-" D)861D"45322PP06 -" D):6YC



M5#I



M14-870T*"0EJ90E,-C0-" D);&5A"45!6"Q&3$%4.E]$051!6S T:%U;14%8



M;&5A"45!6"Q&3$%4.E]$051!6S W16A=6T5!6"HX70T*"0EJ;7  <VAO<G0)

M+'=O<F0 <'1R(#A



M"DQ!,SH)"6QE80E%05 L1DQ!5#I?1$%405LP-SAH75M%05 J.%T-"DQ!03H)



M4TD-" D)<&]P"45"6 T*"0ER970-"E]?9V5T97AT96YD961K97EC;V1E"65N

M: E%0E -" D);6]V"45"4"Q%4U -" D)<'5S: E%0U -" D)<'5S: E%0U -






M9'=O<F0 <'1R(%]?:6UP7U]'971.=6UB97)/9D-O;G-O;&5);G!U=$5V96YT






M"7!U<V )9'=O<F0 <'1R(%]?8V]N:6YP9F -" D)8V%L; ED=V]R9"!P='( 














` end
Jun 25 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:bddm8e$g25$1 digitaldaemon.com...
 I could get the .obj and then .asm of that getch function. Now, I don't
know
 anything about assembler, so can somebody explain how I can make this work
 with DMD? (getch.asm generated by obj2asm attached)
I don't understand what you're asking. If the .obj file you have should take priority, put it first on the linker command. If it is still pulling in the phobos version, I suspect the names are different.
Jun 26 2003
parent reply "Carlos Santander B." <carlos8294 msn.com> writes:
"Walter" <walter digitalmars.com> escribiσ en el mensaje
news:bdg52b$2vb1$1 digitaldaemon.com...
|
| I don't understand what you're asking. If the .obj file you have should
take
| priority, put it first on the linker command. If it is still pulling in
the
| phobos version, I suspect the names are different.
|

The names are the same. What I don't understand is the "put first" thing,
because I even tried putting it (the obj) before my actual d code, but it
still didn't work.

—————————————————————————
Carlos Santander


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 2003-06-25
Jun 26 2003
next sibling parent Helmut Leitner <leitner hls.via.at> writes:
"Carlos Santander B." wrote:
 
 "Walter" <walter digitalmars.com> escribiσ en el mensaje
 news:bdg52b$2vb1$1 digitaldaemon.com...
 |
 | I don't understand what you're asking. If the .obj file you have should
 take
 | priority, put it first on the linker command. If it is still pulling in
 the
 | phobos version, I suspect the names are different.
 |
 
 The names are the same. What I don't understand is the "put first" thing,
 because I even tried putting it (the obj) before my actual d code, but it
 still didn't work.
As I said, you are up to the mercy of the linker(s). It's a "good old C rule" to not rely on that. If you happen to be lucky you can remove to offending .obj from the library using some lib tool (any has options to add/del/extract .obj files) which effectively prevents its use. If it is bundled with other functions in an .obj then you may be out of luck. -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Jun 27 2003
prev sibling parent "Walter" <walter digitalmars.com> writes:
"Carlos Santander B." <carlos8294 msn.com> wrote in message
news:bdgcha$4v8$1 digitaldaemon.com...
 The names are the same. What I don't understand is the "put first" thing,
 because I even tried putting it (the obj) before my actual d code, but it
 still didn't work.
dmc a.obj b.obj a.obj is first to the linker.
Jul 02 2003