D.gnu - Remove libphobos dependency
- Vincent Richomme (6/6) Jul 12 2008 Hi,
- Lars Ivar Igesund (10/21) Jul 12 2008 Look to Tango?
- Vincent Richomme (68/89) Jul 12 2008 Sounds interesting buf in a first step I would like no lib.
- e-t172 (2/4) Jul 12 2008 It's -nophoboslib, actually.
- Vincent Richomme (2/7) Jul 13 2008 In which file should I add this parameter ?
- Vincent Richomme (2/10) Jul 13 2008 Hum maybe you mean when calling gdc compiler.
- David Friedman (7/18) Jul 14 2008 -nophoboslib in the link command is the way to go. This lets you link
Hi, I am interested in D language but libphobos library is far from being portable and development is too slow. I would like to know how can I remove libphobos dependecy because from what I see now I cannot compile a simple example without it. Thanks
Jul 12 2008
Vincent Richomme wrote:Hi, I am interested in D language but libphobos library is far from being portable and development is too slow. I would like to know how can I remove libphobos dependecy because from what I see now I cannot compile a simple example without it. ThanksLook to Tango? http://www.dsource.org/projects/tango As for GDC specific, see the --nostdlib switch or something along those lines. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango
Jul 12 2008
Lars Ivar Igesund a écrit :Vincent Richomme wrote:Sounds interesting buf in a first step I would like no lib. I just want to display a message box on a wince platform. There's something I don't understand with D language , I can see that on a sample given here http://www.digitalmars.com/d/2.0/index.html import std.stdio; void main(string[] args) { .... } but when I look ar D for win32 I can see this : import std.c.windows.windows; extern (C) void gc_init(); extern (C) void gc_term(); extern (C) void _minit(); extern (C) void _moduleCtor(); extern (C) void _moduleDtor(); extern (C) void _moduleUnitTests(); extern (Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int result; gc_init(); // initialize garbage collector _minit(); // initialize module constructor table try { _moduleCtor(); // call module constructors _moduleUnitTests(); // run unit tests (optional) result = myWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow); _moduleDtor(); // call module destructors } catch (Object o) // catch any uncaught exceptions { MessageBoxA(null, cast(char *)o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION); result = 0; // failed } gc_term(); // run finalizers; terminate garbage collector return result; } int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { /* ... insert user code here ... */ } In this second example there are lots of code about garbage collection (gc_init, ...)while in the first sample there are not. Does it mean on windows we always have to call gc_init ? Is it specific to Windows platform , GDC compiler or libphobos lib ? Last question about auto keyword, does it mean variable is handled by garbage collector : foreach (argc, argv; args) { // Object Oriented Programming auto cl = new CmdLin(argc, argv); // Improved typesafe printf writeln(cl.argnum, cl.suffix, " arg: ", cl.argv); // Automatic or explicit memory management delete cl; } in the code below I don't understand why to declare auto if then it is destroyed manually ...Hi, I am interested in D language but libphobos library is far from being portable and development is too slow. I would like to know how can I remove libphobos dependecy because from what I see now I cannot compile a simple example without it. ThanksLook to Tango? http://www.dsource.org/projects/tango As for GDC specific, see the --nostdlib switch or something along those lines.
Jul 12 2008
Lars Ivar Igesund a écrit :As for GDC specific, see the --nostdlib switch or something along those lines.It's -nophoboslib, actually.
Jul 12 2008
e-t172 a écrit :Lars Ivar Igesund a écrit :In which file should I add this parameter ?As for GDC specific, see the --nostdlib switch or something along those lines.It's -nophoboslib, actually.
Jul 13 2008
Vincent Richomme a écrit :e-t172 a écrit :Hum maybe you mean when calling gdc compiler.Lars Ivar Igesund a écrit :In which file should I add this parameter ?As for GDC specific, see the --nostdlib switch or something along those lines.It's -nophoboslib, actually.
Jul 13 2008
Vincent Richomme wrote:Vincent Richomme a écrit :-nophoboslib in the link command is the way to go. This lets you link against libgcc without having the link libgphobos and the the system pthread libraries. If you are using the GNU linker, you can also reduce link dependencies by compiling with -ffunction-sections and -fdata-sections and then link with -Wl,-gc-sections.e-t172 a écrit :Hum maybe you mean when calling gdc compiler.Lars Ivar Igesund a écrit :In which file should I add this parameter ?As for GDC specific, see the --nostdlib switch or something along those lines.It's -nophoboslib, actually.
Jul 14 2008