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

 Probably getch is part of the C RTL instead of phobos. Anyway, how can I

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

 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