www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Changes on dynamic shared library writing

reply "tcak" <1ltkrs+3wyh1ow7kzn1k sharklasers.com> writes:
After a long time (Failed many times before), I checked the page 
http://dlang.org/dll-linux.html again. It shows a message on top 
saying that preliminary and subject to change.

Exactly what changes are expected? Where can I learn about them? 
I would do tests again with dynamic library writing on Linux.
Jul 29 2015
parent reply "tcak" <1ltkrs+3wyh1ow7kzn1k sharklasers.com> writes:
On Wednesday, 29 July 2015 at 19:41:14 UTC, tcak wrote:
 After a long time (Failed many times before), I checked the 
 page http://dlang.org/dll-linux.html again. It shows a message 
 on top saying that preliminary and subject to change.

 Exactly what changes are expected? Where can I learn about 
 them? I would do tests again with dynamic library writing on 
 Linux.
Still same problem. I copied and pasted the latest codes from that web page. A D library, and a D executable is created. I copied the libphobos2.so from /usr/lib/x86_64-linux-gnu/libphobos2.so to current directory. Changed both of rpath values to "." to indicated local phobos library. Everything works correctly. Then I copied main, dll, and libphobos to UbuntuMATE on VirtualBox. It runs on Live CD. Then tried to execute main there. Result is as below: ./app.exe: error while loading shared libraries: libphobos2.so.0.67: cannot open shared object file: No such file or directory This was happening before and still same. I want to develop the app and library, and copy it to web server where DMD won't be installed. This is creating problem to me.
Jul 29 2015
parent reply Rikki Cattermole <alphaglosined gmail.com> writes:
On 30/07/2015 8:27 a.m., tcak wrote:
 On Wednesday, 29 July 2015 at 19:41:14 UTC, tcak wrote:
 After a long time (Failed many times before), I checked the page
 http://dlang.org/dll-linux.html again. It shows a message on top
 saying that preliminary and subject to change.

 Exactly what changes are expected? Where can I learn about them? I
 would do tests again with dynamic library writing on Linux.
Still same problem. I copied and pasted the latest codes from that web page. A D library, and a D executable is created. I copied the libphobos2.so from /usr/lib/x86_64-linux-gnu/libphobos2.so to current directory. Changed both of rpath values to "." to indicated local phobos library. Everything works correctly. Then I copied main, dll, and libphobos to UbuntuMATE on VirtualBox. It runs on Live CD. Then tried to execute main there. Result is as below: ./app.exe: error while loading shared libraries: libphobos2.so.0.67: cannot open shared object file: No such file or directory This was happening before and still same. I want to develop the app and library, and copy it to web server where DMD won't be installed. This is creating problem to me.
Did you try renaming "libphobos2.so" to "libphobos2.so.0.67"? After all, that is what it is looking for.
Jul 29 2015
parent "tcak" <1ltkrs+3wyh1ow7kzn1k sharklasers.com> writes:
On Thursday, 30 July 2015 at 03:52:16 UTC, Rikki Cattermole wrote:
 On 30/07/2015 8:27 a.m., tcak wrote:
 On Wednesday, 29 July 2015 at 19:41:14 UTC, tcak wrote:
 After a long time (Failed many times before), I checked the 
 page
 http://dlang.org/dll-linux.html again. It shows a message on 
 top
 saying that preliminary and subject to change.

 Exactly what changes are expected? Where can I learn about 
 them? I
 would do tests again with dynamic library writing on Linux.
Still same problem. I copied and pasted the latest codes from that web page. A D library, and a D executable is created. I copied the libphobos2.so from /usr/lib/x86_64-linux-gnu/libphobos2.so to current directory. Changed both of rpath values to "." to indicated local phobos library. Everything works correctly. Then I copied main, dll, and libphobos to UbuntuMATE on VirtualBox. It runs on Live CD. Then tried to execute main there. Result is as below: ./app.exe: error while loading shared libraries: libphobos2.so.0.67: cannot open shared object file: No such file or directory This was happening before and still same. I want to develop the app and library, and copy it to web server where DMD won't be installed. This is creating problem to me.
Did you try renaming "libphobos2.so" to "libphobos2.so.0.67"? After all, that is what it is looking for.
I copied libphobos to /usr/lib/x86_64.../ Then created a soft link with "ln -s" for libphobos2.so.0.67. But later I realised that link wasn't set correctly. Before that I wrote the message. So thankfully it works now. But I am still wondering what changes would be coming to there. There was a thread I was reading that is started by Andrei in 2012 about shared library issues. Someone asks whether they are resolved in 2013, another asks in 2014. Now we are in 2015. I am not sure if there is any resolutions about them.
Jul 29 2015