Thread overview
not using phobos
Jun 25, 2003
Helmut Leitner
Jun 25, 2003
Walter
Jun 27, 2003
Walter
Jun 27, 2003
Helmut Leitner
Jul 02, 2003
Walter
June 25, 2003
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


June 25, 2003

"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
June 25, 2003
"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.


June 26, 2003
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



June 27, 2003
"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.


June 27, 2003
"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


June 27, 2003

"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
July 02, 2003
"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.