Thread overview | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
September 15, 2005 How to link phobos funcs w/o full library? | ||||
---|---|---|---|---|
| ||||
I have my own library, say BestPrintfLib. :) It's windows executable so I call manually gc_init(), _moduleCtor() and so on. And I have my own "printf" function which of course conflicts with existing one in phobos. I _MUST_NOT_ rename function, this is requirement. Question: Can I link to my project only USED standard functions? Or may be there is way to create windows program with garbage collector but w/o using phobos? |
September 15, 2005 Re: How to link phobos funcs w/o full library? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Newbie | In article <dgc07u$193q$1@digitaldaemon.com>, Newbie says... > >I have my own library, say BestPrintfLib. :) It's windows executable so I call manually gc_init(), _moduleCtor() and so on. And I have my own "printf" function which of course conflicts with existing one in phobos. I _MUST_NOT_ rename function, this is requirement. Question: Can I link to my project only USED standard functions? Or may be there is way to create windows program with garbage collector but w/o using phobos? You will have to the portions of Phobos that conflict with your code. Alternately, you should be able to use Ares: http://www.dsource.org/projects/ares/ Sean |
September 15, 2005 Re: How to link phobos funcs w/o full library? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean Kelly | I'd like to use Ares, but I'm still unsure how to use it . Do I still need phobos for std.string / std.math functions etc ? What is library_spec describing , changes to phobos' types ? Some examples and maybe a tutorial would go a long way :). Charlie "Sean Kelly" <sean@f4.ca> wrote in message news:dgc7c8$1gug$1@digitaldaemon.com... > In article <dgc07u$193q$1@digitaldaemon.com>, Newbie says... > > > >I have my own library, say BestPrintfLib. :) It's windows executable so I call > >manually gc_init(), _moduleCtor() and so on. And I have my own "printf" function > >which of course conflicts with existing one in phobos. I _MUST_NOT_ rename > >function, this is requirement. Question: Can I link to my project only USED > >standard functions? Or may be there is way to create windows program with garbage collector but w/o using phobos? > > You will have to the portions of Phobos that conflict with your code. Alternately, you should be able to use Ares: > > http://www.dsource.org/projects/ares/ > > Sean > > |
September 15, 2005 Re: How to link phobos funcs w/o full library? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Charles | In article <dgcg55$1rtk$1@digitaldaemon.com>, Charles says... > >I'd like to use Ares, but I'm still unsure how to use it . Do I still need phobos for std.string / std.math functions etc ? What is library_spec describing , changes to phobos' types ? Some examples and maybe a tutorial would go a long way :). Sorry about that :-) At the moment, Ares contains very little beyond but what is essential to run a D application. So anything you use from the 'std' portion of Phobos is likely not present. Once I get the next release out I'll work on a short tutorial of how to use Ares. And ignore the library_spec file for now--it's nearly empty and long out of date. I'm waiting for DMD's built-in code documenter before I do any more on that end. Sean |
September 16, 2005 Re: How to link phobos funcs w/o full library? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean Kelly | >You will have to the portions of Phobos that conflict with your code.
Sorry, Sean, I'm not so good in English. What you mean "portions"?
In my code I import nothing from Phobos except init/finish functions (I import
those manually). But when I link my OBJ I get error about conflict. What I need
to do?
|
September 16, 2005 Re: How to link phobos funcs w/o full library? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Newbie | In article <dgegm3$o8s$1@digitaldaemon.com>, Newbie says... > >>You will have to the portions of Phobos that conflict with your code. > >Sorry, Sean, I'm not so good in English. What you mean "portions"? >In my code I import nothing from Phobos except init/finish functions (I import >those manually). But when I link my OBJ I get error about conflict. What I need >to do? I left out a word by mistake. I meant "remove the portions of Phobos that conflict." Delete references to those objects files in win32.mak or linux.mak. Sean |
September 16, 2005 Re: How to link phobos funcs w/o full library? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean Kelly | In article <dgcig4$1ukf$1@digitaldaemon.com>, Sean Kelly says... > >In article <dgcg55$1rtk$1@digitaldaemon.com>, Charles says... >> >>I'd like to use Ares, but I'm still unsure how to use it . Do I still need phobos for std.string / std.math functions etc ? What is library_spec describing , changes to phobos' types ? Some examples and maybe a tutorial would go a long way :). > >Sorry about that :-) At the moment, Ares contains very little beyond but what is essential to run a D application. So anything you use from the 'std' portion of Phobos is likely not present. Once I get the next release out I'll work on a short tutorial of how to use Ares. I've fleshed out the readme in this release. It now contains a bit more information on what everything is and how to install and build against the Ares library. If there's any more information you think would be useful, please let me know. Documentation isn't my strong suit :) Sean |
September 19, 2005 Re: How to link phobos funcs w/o full library? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean Kelly | >>Sorry, Sean, I'm not so good in English. What you mean "portions"? >>In my code I import nothing from Phobos except init/finish functions (I import >>those manually). But when I link my OBJ I get error about conflict. >I left out a word by mistake. I meant "remove the portions of Phobos that conflict." Delete references to those objects files in win32.mak or linux.mak. OK, as I understood I need to RECOMPILE Phobos w/o object files, which conflicts with my own. Right? Question 2: Is there some priority mechanism to solve "duplicates" conflict? For example, first resolve all symbols thru LIB1, and all unreferenced symbols thru LIB2? |
September 19, 2005 Re: How to link phobos funcs w/o full library? | ||||
---|---|---|---|---|
| ||||
Posted in reply to adv. newbie | In article <dgm5ek$1dhe$1@digitaldaemon.com>, adv. newbie says... > >>>Sorry, Sean, I'm not so good in English. What you mean "portions"? >>>In my code I import nothing from Phobos except init/finish functions (I import >>>those manually). But when I link my OBJ I get error about conflict. > >>I left out a word by mistake. I meant "remove the portions of Phobos that conflict." Delete references to those objects files in win32.mak or linux.mak. > >OK, as I understood I need to RECOMPILE Phobos w/o object files, which conflicts with my own. Right? Right. >Question 2: Is there some priority mechanism to solve "duplicates" conflict? For example, first resolve all symbols thru LIB1, and all unreferenced symbols thru LIB2? Not that I'm aware of, but such a mechanism wouldn't work with Phobos anyway, as Phobos is implicitly linked to all D programs by DMD. If such a mechanism were in place, it would always find the symbols from Phobos before it searched your library. Sean |
Copyright © 1999-2021 by the D Language Foundation