digitalmars.D.learn - -L-ldl needed on Linux
- Bill Baxter (13/13) Apr 12 2008 Just wondering why I have to give dsss the -L-ldl flag manually when I
- Unknown W. Brackets (4/21) Apr 12 2008 Isn't this what the "lib" pragma is for, if you don't want to have to
- Bill Baxter (7/30) Apr 12 2008 I suppose so (or "link" pragma using dsss/bud). So you're saying it
- Tower Ty (40/41) Apr 12 2008 I'm interested here in understanding another difference between Linux an...
- Bill Baxter (5/53) Apr 12 2008 I don't believe what Chris told you is true. I just used Entice
- Bill Baxter (4/61) Apr 12 2008 Well, ok, maybe "many" is a bit of an overstatement. But it did not
- Unknown W. Brackets (10/45) Apr 12 2008 Yes, I'd think it's Derelict's fault personally. On Windows,
- Lars Ivar Igesund (16/33) Apr 12 2008 It may be that it is derelict's fault for not working with the tools, bu...
- Unknown W. Brackets (6/41) Apr 12 2008 I had no idea. I guess I should try to get my sneaker out of my mouth
- Bill Baxter (5/36) Apr 12 2008 That's certainly a problem.
- Mike Parker (5/25) Apr 12 2008 How is that going to help with the final executable? No linking is done
- Bill Baxter (6/34) Apr 12 2008 You wouldn't put it in Derelict's dsss.conf, you'd put it in
- Mike Parker (2/37) Apr 13 2008 I see now. I've updated the Derelict trunk with the pragma link.
- Lars Ivar Igesund (9/47) Apr 13 2008 For reference, this is where I think that pragma lib should be available
- Bill Baxter (11/49) Apr 13 2008 Agreed. I think it's yet another one of those things that has been
- Spacen Jasset (10/27) Apr 14 2008 It's sort of the Linux way I guess. You have to do this using C++ to use...
- Bill Baxter (5/37) Apr 14 2008 Mike/Aldacron added the link pragma to Derelict's svn yesterday. So at
Just wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux. Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame? * Is it DMD's fault for not including in the default link libs? * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?) * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux? Any of those seem possible. So anyone know the answer? Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file? --bb
Apr 12 2008
Isn't this what the "lib" pragma is for, if you don't want to have to pass it? -[Unknown] Bill Baxter wrote:Just wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux. Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame? * Is it DMD's fault for not including in the default link libs? * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?) * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux? Any of those seem possible. So anyone know the answer? Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file? --bb
Apr 12 2008
Unknown W. Brackets wrote:Isn't this what the "lib" pragma is for, if you don't want to have to pass it?I suppose so (or "link" pragma using dsss/bud). So you're saying it could be considered "Derelict's fault" for not providing that pragma. On Windows, the equivalent libs (containing LoadLibraryA/FreeLibrary/GetProcAddress) seem to be linked by default, by someone in the toolchain. DMD or DSSS, I'm not sure which. So it seems reasonable that it should be there by default under Linux, too.-[Unknown] Bill Baxter wrote:Just wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux. Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame? * Is it DMD's fault for not including in the default link libs? * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?) * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux? Any of those seem possible. So anyone know the answer? Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file? --bb
Apr 12 2008
Bill Baxter Wrote:Unknown W. Brackets wrote:I'm interested here in understanding another difference between Linux and Windows. Chris Miller used Entice Designer to construct a GUI with the following imports 1 /* 2 Generated by Entice Designer 3 Entice Designer written by Christopher E. Miller 4 www.dprogramming.com/entice.php 5 */ 6 7 import dwt.DWT; 8 import dwt.widgets.Display, dwt.widgets.Shell; 9 import dwt.widgets.Group, dwt.widgets.Text; 10 import dwt.widgets.Label, dwt.widgets.Combo; 11 import dwt.graphics.Color, dwt.graphics.Rectangle; 12 import dwt.widgets.MessageBox; 13 14 15 class MyShell 16 { 17 // Do not modify or move this block of variables. 18 //~Entice Designer variables begin here. 19 dwt.widgets.Shell.Shell shell; 20 dwt.widgets.Group.Group group1; 21 dwt.widgets.Text.Text text3; 22 dwt.widgets.Label.Label label5; 23 dwt.widgets.Text.Text Date; 24 dwt.widgets.Combo.Combo Payee; 25 dwt.widgets.Text.Text Code; 26 dwt.widgets.Text.Text ChequeNo; 27 dwt.widgets.Text.Text Details; 28 dwt.widgets.Button.Button OKButton; 29 dwt.widgets.Text.Text Credit; 30 dwt.widgets.Text.Text Debit; 31 dwt.widgets.Table.Table DataTable; 32 //~Entice Designer variables end here. Now he tells me that this compiles in windows as is . Notice he uses a Table . When I take the same program and compile it on Linux I must add " Import dwt.widgets.Table" or it will not compile. Now I am wondering if your problem with d l l ' s is similar ? Some built in assumptions that Linux does not have .
Apr 12 2008
Tower Ty wrote:Bill Baxter Wrote:I don't believe what Chris told you is true. I just used Entice designer to make a DWT gui on Windows yesterday, and it was missing many imports and wouldn't compile out of the box without adding them. --bbUnknown W. Brackets wrote:I'm interested here in understanding another difference between Linux and Windows. Chris Miller used Entice Designer to construct a GUI with the following imports 1 /* 2 Generated by Entice Designer 3 Entice Designer written by Christopher E. Miller 4 www.dprogramming.com/entice.php 5 */ 6 7 import dwt.DWT; 8 import dwt.widgets.Display, dwt.widgets.Shell; 9 import dwt.widgets.Group, dwt.widgets.Text; 10 import dwt.widgets.Label, dwt.widgets.Combo; 11 import dwt.graphics.Color, dwt.graphics.Rectangle; 12 import dwt.widgets.MessageBox; 13 14 15 class MyShell 16 { 17 // Do not modify or move this block of variables. 18 //~Entice Designer variables begin here. 19 dwt.widgets.Shell.Shell shell; 20 dwt.widgets.Group.Group group1; 21 dwt.widgets.Text.Text text3; 22 dwt.widgets.Label.Label label5; 23 dwt.widgets.Text.Text Date; 24 dwt.widgets.Combo.Combo Payee; 25 dwt.widgets.Text.Text Code; 26 dwt.widgets.Text.Text ChequeNo; 27 dwt.widgets.Text.Text Details; 28 dwt.widgets.Button.Button OKButton; 29 dwt.widgets.Text.Text Credit; 30 dwt.widgets.Text.Text Debit; 31 dwt.widgets.Table.Table DataTable; 32 //~Entice Designer variables end here. Now he tells me that this compiles in windows as is . Notice he uses a Table . When I take the same program and compile it on Linux I must add " Import dwt.widgets.Table" or it will not compile. Now I am wondering if your problem with d l l ' s is similar ? Some built in assumptions that Linux does not have .
Apr 12 2008
Bill Baxter wrote:Tower Ty wrote:Well, ok, maybe "many" is a bit of an overstatement. But it did not compile out of the box without adding some additional imports. --bbBill Baxter Wrote:I don't believe what Chris told you is true. I just used Entice designer to make a DWT gui on Windows yesterday, and it was missing many imports and wouldn't compile out of the box without adding them.Unknown W. Brackets wrote:I'm interested here in understanding another difference between Linux and Windows. Chris Miller used Entice Designer to construct a GUI with the following imports 1 /* 2 Generated by Entice Designer 3 Entice Designer written by Christopher E. Miller 4 www.dprogramming.com/entice.php 5 */ 6 7 import dwt.DWT; 8 import dwt.widgets.Display, dwt.widgets.Shell; 9 import dwt.widgets.Group, dwt.widgets.Text; 10 import dwt.widgets.Label, dwt.widgets.Combo; 11 import dwt.graphics.Color, dwt.graphics.Rectangle; 12 import dwt.widgets.MessageBox; 13 14 15 class MyShell 16 { 17 // Do not modify or move this block of variables. 18 //~Entice Designer variables begin here. 19 dwt.widgets.Shell.Shell shell; 20 dwt.widgets.Group.Group group1; 21 dwt.widgets.Text.Text text3; 22 dwt.widgets.Label.Label label5; 23 dwt.widgets.Text.Text Date; 24 dwt.widgets.Combo.Combo Payee; 25 dwt.widgets.Text.Text Code; 26 dwt.widgets.Text.Text ChequeNo; 27 dwt.widgets.Text.Text Details; 28 dwt.widgets.Button.Button OKButton; 29 dwt.widgets.Text.Text Credit; 30 dwt.widgets.Text.Text Debit; 31 dwt.widgets.Table.Table DataTable; 32 //~Entice Designer variables end here. Now he tells me that this compiles in windows as is . Notice he uses a Table . When I take the same program and compile it on Linux I must add " Import dwt.widgets.Table" or it will not compile. Now I am wondering if your problem with d l l ' s is similar ? Some built in assumptions that Linux does not have .
Apr 12 2008
Yes, I'd think it's Derelict's fault personally. On Windows, LoadLibraryA is (as far as I know) in the same library as a bunch of other things you're going to need. On Linux, it's separated into its own thing. It's potentially possible you might want to write a Linux executable that does not require libdl, specifically for a system which might not have it. That said, it seems fairly unlikely. Surely you can change the dmd.conf file to automatically pass -L-ldl to dmd, solving your problem? -[Unknown] Bill Baxter wrote:Unknown W. Brackets wrote:Isn't this what the "lib" pragma is for, if you don't want to have to pass it?I suppose so (or "link" pragma using dsss/bud). So you're saying it could be considered "Derelict's fault" for not providing that pragma. On Windows, the equivalent libs (containing LoadLibraryA/FreeLibrary/GetProcAddress) seem to be linked by default, by someone in the toolchain. DMD or DSSS, I'm not sure which. So it seems reasonable that it should be there by default under Linux, too.-[Unknown] Bill Baxter wrote:Just wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux. Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame? * Is it DMD's fault for not including in the default link libs? * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?) * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux? Any of those seem possible. So anyone know the answer? Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file? --bb
Apr 12 2008
Bill Baxter wrote:Just wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux. Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame? * Is it DMD's fault for not including in the default link libs? * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?) * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux? Any of those seem possible. So anyone know the answer? Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file? --bbIt may be that it is derelict's fault for not working with the tools, but there is also the relevant bugzilla entries http://d.puremagic.com/issues/show_bug.cgi?id=1663 and http://d.puremagic.com/issues/show_bug.cgi?id=1690 pragma(lib) should be implemented on all platforms, or removed from the spec entirely. I'd certainly prefer the former, as this probably is the one thing that a build tool normally cannot do much beyond what the compiler already does by telling the linker about always needed libraries (like the runtime). -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the Tango
Apr 12 2008
I had no idea. I guess I should try to get my sneaker out of my mouth now... I may see if I can find time to attach a patch in there (seems like something completely solvable using the frontend.) -[Unknown] Lars Ivar Igesund wrote:Bill Baxter wrote:Just wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux. Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame? * Is it DMD's fault for not including in the default link libs? * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?) * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux? Any of those seem possible. So anyone know the answer? Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file? --bbIt may be that it is derelict's fault for not working with the tools, but there is also the relevant bugzilla entries http://d.puremagic.com/issues/show_bug.cgi?id=1663 and http://d.puremagic.com/issues/show_bug.cgi?id=1690 pragma(lib) should be implemented on all platforms, or removed from the spec entirely. I'd certainly prefer the former, as this probably is the one thing that a build tool normally cannot do much beyond what the compiler already does by telling the linker about always needed libraries (like the runtime).
Apr 12 2008
Lars Ivar Igesund wrote:Bill Baxter wrote:That's certainly a problem. However, Derelict supports DSSS, so that's not really an excuse for Derelict. It could use DSSS's pragma(link). --bbJust wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux. Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame? * Is it DMD's fault for not including in the default link libs? * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?) * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux? Any of those seem possible. So anyone know the answer? Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file? --bbIt may be that it is derelict's fault for not working with the tools, but there is also the relevant bugzilla entries http://d.puremagic.com/issues/show_bug.cgi?id=1663 and http://d.puremagic.com/issues/show_bug.cgi?id=1690 pragma(lib) should be implemented on all platforms, or removed from the spec entirely.
Apr 12 2008
Bill Baxter wrote:Lars Ivar Igesund wrote:How is that going to help with the final executable? No linking is done during the compilation of static libraries, so even if I did add that to Derelict's dsss.conf files, the user would still have to link to libdl when compiling the executable.It may be that it is derelict's fault for not working with the tools, but there is also the relevant bugzilla entries http://d.puremagic.com/issues/show_bug.cgi?id=1663 and http://d.puremagic.com/issues/show_bug.cgi?id=1690 pragma(lib) should be implemented on all platforms, or removed from the spec entirely.That's certainly a problem. However, Derelict supports DSSS, so that's not really an excuse for Derelict. It could use DSSS's pragma(link). --bb
Apr 12 2008
Mike Parker wrote:Bill Baxter wrote:You wouldn't put it in Derelict's dsss.conf, you'd put it in derelict/util/loader.d. And it would end up in the .di file, where it would be found by dsss later when users are trying to compile something that uses loader. --bbLars Ivar Igesund wrote:How is that going to help with the final executable? No linking is done during the compilation of static libraries, so even if I did add that to Derelict's dsss.conf files, the user would still have to link to libdl when compiling the executable.It may be that it is derelict's fault for not working with the tools, but there is also the relevant bugzilla entries http://d.puremagic.com/issues/show_bug.cgi?id=1663 and http://d.puremagic.com/issues/show_bug.cgi?id=1690 pragma(lib) should be implemented on all platforms, or removed from the spec entirely.That's certainly a problem. However, Derelict supports DSSS, so that's not really an excuse for Derelict. It could use DSSS's pragma(link). --bb
Apr 12 2008
Bill Baxter wrote:Mike Parker wrote:I see now. I've updated the Derelict trunk with the pragma link.Bill Baxter wrote:You wouldn't put it in Derelict's dsss.conf, you'd put it in derelict/util/loader.d. And it would end up in the .di file, where it would be found by dsss later when users are trying to compile something that uses loader.Lars Ivar Igesund wrote:How is that going to help with the final executable? No linking is done during the compilation of static libraries, so even if I did add that to Derelict's dsss.conf files, the user would still have to link to libdl when compiling the executable.It may be that it is derelict's fault for not working with the tools, but there is also the relevant bugzilla entries http://d.puremagic.com/issues/show_bug.cgi?id=1663 and http://d.puremagic.com/issues/show_bug.cgi?id=1690 pragma(lib) should be implemented on all platforms, or removed from the spec entirely.That's certainly a problem. However, Derelict supports DSSS, so that's not really an excuse for Derelict. It could use DSSS's pragma(link). --bb
Apr 13 2008
Mike Parker wrote:Bill Baxter wrote:For reference, this is where I think that pragma lib should be available from the compiler instead, such that the correct lib will be linked even with a different build tool. -- Lars Ivar Igesund blog at http://larsivi.net DSource, #d.tango & #D: larsivi Dancing the TangoMike Parker wrote:I see now. I've updated the Derelict trunk with the pragma link.Bill Baxter wrote:You wouldn't put it in Derelict's dsss.conf, you'd put it in derelict/util/loader.d. And it would end up in the .di file, where it would be found by dsss later when users are trying to compile something that uses loader.Lars Ivar Igesund wrote:How is that going to help with the final executable? No linking is done during the compilation of static libraries, so even if I did add that to Derelict's dsss.conf files, the user would still have to link to libdl when compiling the executable.It may be that it is derelict's fault for not working with the tools, but there is also the relevant bugzilla entries http://d.puremagic.com/issues/show_bug.cgi?id=1663 and http://d.puremagic.com/issues/show_bug.cgi?id=1690 pragma(lib) should be implemented on all platforms, or removed from the spec entirely.That's certainly a problem. However, Derelict supports DSSS, so that's not really an excuse for Derelict. It could use DSSS's pragma(link). --bb
Apr 13 2008
Lars Ivar Igesund wrote:Mike Parker wrote:Agreed. I think it's yet another one of those things that has been debated, hailed by all, then ignored, then forgotten. But DSSS takes the feature from Bud, I believe. So if all D-aware build tools implement it, then it's not so bad. Of course that doesn't help 'make' users. Incidentially, this may be a good time to once again bring up Gregor's proposal of dmd -v spitting out pragmas in addition to imports. It would make supporting things like pragma("link") much easier for any build tool that wanted to. --bbBill Baxter wrote:For reference, this is where I think that pragma lib should be available from the compiler instead, such that the correct lib will be linked even with a different build tool.Mike Parker wrote:I see now. I've updated the Derelict trunk with the pragma link.Bill Baxter wrote:You wouldn't put it in Derelict's dsss.conf, you'd put it in derelict/util/loader.d. And it would end up in the .di file, where it would be found by dsss later when users are trying to compile something that uses loader.Lars Ivar Igesund wrote:How is that going to help with the final executable? No linking is done during the compilation of static libraries, so even if I did add that to Derelict's dsss.conf files, the user would still have to link to libdl when compiling the executable.It may be that it is derelict's fault for not working with the tools, but there is also the relevant bugzilla entries http://d.puremagic.com/issues/show_bug.cgi?id=1663 and http://d.puremagic.com/issues/show_bug.cgi?id=1690 pragma(lib) should be implemented on all platforms, or removed from the spec entirely.That's certainly a problem. However, Derelict supports DSSS, so that's not really an excuse for Derelict. It could use DSSS's pragma(link). --bb
Apr 13 2008
Bill Baxter wrote:Just wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux. Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame? * Is it DMD's fault for not including in the default link libs? * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?) * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux? Any of those seem possible. So anyone know the answer? Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file? --bbIt's sort of the Linux way I guess. You have to do this using C++ to use any of the dynamic binding functions. A dsss link pragma seems to be the solution for the moment. Or, you can list lib 'dl' in your dsss.conf and you will get a warning on windows but it will still link correctly. buildflags=-g -lldl -debug -unittest -Dddocs -profile OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. dl.lib Warning 2: File Not Found dl.lib
Apr 14 2008
Spacen Jasset wrote:Bill Baxter wrote:Mike/Aldacron added the link pragma to Derelict's svn yesterday. So at least with DSSS (and bud I think) the -L-ldl is no longer needed for building programs with Derelict. --bbJust wondering why I have to give dsss the -L-ldl flag manually when I compile a Derelict-using program under Linux. Seems like it shouldn't be neecessary for me to have to specify that. But who's to blame? * Is it DMD's fault for not including in the default link libs? * Is it DSSS's fault for not picking up that it's needed (or for not puttin it in the default list of flags?) * Is it Derelict's fault for somehow not telling DSSS that it wants to use libdl on Linux? Any of those seem possible. So anyone know the answer? Or is it just my fault for thinking I shouldn't have to stick a version(linux) block in my dsss.conf file? --bbIt's sort of the Linux way I guess. You have to do this using C++ to use any of the dynamic binding functions. A dsss link pragma seems to be the solution for the moment. Or, you can list lib 'dl' in your dsss.conf and you will get a warning on windows but it will still link correctly. buildflags=-g -lldl -debug -unittest -Dddocs -profile OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. dl.lib Warning 2: File Not Found dl.lib
Apr 14 2008