Well I'm progressing -slowly

John Reimer terminal.node at gmail.com
Tue Feb 19 07:09:36 PST 2008


Ty Tower wrote:
> John Reimer Wrote:
>> On Linux, linking is exactly the same for static and dynamic libraries. 
>>   This is one of the advantages of the linux system.  There is no dll or 
>> import library complexity to deal with as there is on Windows.
>>
>> The difference with the developer packages is that they usually supply 
>> both the static and dynamic libs without the postfix version numbers, 
>> They also supply the necessary C headers and documentation.
>>
>> Some Linux distributions include the developer versions of the libraries 
>> by default.  Other distributions do not.  Ty might have to download 
>> these libs to get things working... which would explain a lot of the 
>> problems he's been having.
>>
> My distro is Mandriva 2007 spring and I have the developer packages installed.
> As I said the libraries are there under the name of /lib/libm-2.4.so , and linked  to it is  libm.so.6
> 
> 


Okay.  I don't know why there isn't a libm.so sym-link to these libs 
than.  Try making one and see what happens.


> 
>> I notice also that the command line error complained "/usr/bin/ld: 
>> cannot find -lm"  which is odd.  It seems to be not interpreting the 
>> commandline flag: I would expect it to say "cannot find libm.a (or 
>> libm.so).  But I'm not certain.  Nonetheless the compiler is looking for 
>> the the non-version decorated libm and cannot find it.
>>
>> Incidentally, libm is the default math library on linux.  Most linux 
>> should have it installed.  The developer lib package may be necessary to 
>> access this library directly, but even then one could access the 
>> non-developer version simply by making a symbolic link to the versioned 
>> one in the lib directory where it resides.  Or one could even provide 
>> the full path the the versioned library on the command line to achieve 
>> the same thing.
>>
>> But instead of fiddling with the system, the user should just download 
>> the necessary developer version of these libraries.
>>
>> Part of these problems seem to be that Ty is unfamiliar with linux, or, 
>> at least, linux development. 
> 
> You assume a lot . and incorrectly at that . I have a fairly intimate knowledge of Linux but this I have not seen before.  I have approached it on a look at what is happening in the compile command from the start and gradually understand what each swith or control is supposed to do and make sure it can do it .  I think I am at the last of that and this problem  is offered for solution by anyone more knowledgeabl than me on compiling and linking.
> 
> I don't think either my approach or your wrong assumption justify the comments below
> 


Okay.  Perhaps I assumed wrong, but it appeared otherwise. I thought 
most linux developers understood that linking to a static or dynamic 
library was achieved the same way on linux (with the -l switch). 
Incidentally, I do not claim to have an intimate knowledge of linux 
developement or linux.  I do have a comfortable working knowledge of it, 
however.


>> If this is the case, there is a LOT more 
>> to help out with then just dmd/dwt related issues.  Linux is not an easy 
>> system to learn to program on since there are many tools with which to 
>> get familiar. Thus, we must assume, to some extent, that the dwt user 
>> has some familiarity with the system he develops on.  It would horribly 
>> time-consuming otherwise to have to step the user through platform 
>> development peculiarities and linux administration.
>>
>> Thankfully, we don't have to do that... since there appears to be an 
>> amazing supply of very accommodating and knowledgeable people here.  But 
>> I do think it is unfair to assume we owe such a user all our time and 
>> attention for such details.
>>
>> -JJR
> 
> 
> If you look at the example program "helloworld1.d"which I will attach here , there are a lot of problems in dwt . The writer's comment is effectively " I don't know why but you have to import the following libraries or you will get linker errors"
> 
> Perhaps if you are going to spend the time to type and post in such quantity you could stick to why you think "-lm" might not be being found .
> 


This is not clearly a dwt issue, so I won't (or shouldn't) devote more 
time to postulating why -lm is not found.  That would be futile for me 
at this point.  You are correct that I spent too much time typing a post 
in such quantity (including this one). libm is a dependency that the dmd 
compiler adds to the command-line, and this has been so for a long time. 
  So if it isn't working right now, I wouldn't blame it on dwt just 
because this is the library you are trying to use right now.  I'd tend 
to look further into why dmd is not working.

Furthermore, I have no idea why one needs to add the Tango imports to 
get things linking correctly.  I suggest you ditch dwt from your system 
and test dmd/dsss/Tango (or perhaps Phobos first) rigorously before you 
even approach dwt again.


> I have tried putting /lib/ in front of my PATH and also at the end to no avail. I have copied both file and link to /usr/lib aain to no avaail . This is my $PATH  
> PATH=/lib:./:/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin/:/usr/games:/usr/lib/qt3/bin:/usr/lib/qt3/bin:/usr/lib/qt3/bin:/usr/local/:/usr/local/lib:/usr/include:/lib
> When I find the cause for the triple qt entry I'll be in heaven.
> 


These are all linux issues (or dmd setup issues).  If these cannot be 
straightened out, I can't help.


> I'm starting to think the library may have been corrupted somehow. Have you had any reports of file corruption by dmd or dsss?
> 
> 


No.  It's very unlikely libm could get corrupted by dmd or dsss... 
unless you run linux as the superuser all the time (which would be a bad 
idea). Even then, I don't know why dmd or dsss would do such a thing. 
Your whole linux distribution would be compromised if they could or did. 
  Even so, ld would probably report the error if libm was corrupt.

Maybe a reinstall of your Linux distribution or a different distribution 
might be the answer.  That may seem like a lame suggestion to you; but 
sadly, this is becoming the best I've got.

-JJR


More information about the Digitalmars-d-dwt mailing list