www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - dmd with shared lib

reply "bioinfornatics" <bioifornatics fedoraproject.org> writes:
Hi, after building and installing dmd i fail to use generated
executable because they are an undefined symbol.


$ /opt/dmd/bin/dmd -L-lcurl testDelegate.d

$ ./testDelegate
./testDelegate: symbol lookup error:
/opt/dmd/lib/libphobos2.so.0.66: undefined symbol:
curl_version_info

$ ldd ./testDelegate
	linux-vdso.so.1 =>  (0x00007fff2d4e8000)
	libcurl.so.4 => /opt/dmd/lib/libcurl.so.4 (0x00007f82fd060000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f82fce58000)
	libphobos2.so.0.66 => /opt/dmd/lib/libphobos2.so.0.66
(0x00007f82fc810000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f82fc5f0000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f82fc2e8000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f82fc0e0000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f82fbd20000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f82fd288000)

given executable is link with libcurl provided by dmd

when i look into these curl lib they are any curl_version_info
symbol




curl_version_info

while this symbol exist on libcurl provided by my fedora


       346: 0000000000023f20   140 FUNC    GLOBAL DEFAULT   11
curl_version_info
May 24 2014
parent reply Dejan Lekic <dejan.lekic gmail.com> writes:
bioinfornatics wrote:

 Hi, after building and installing dmd i fail to use generated
 executable because they are an undefined symbol.
 
 
 $ /opt/dmd/bin/dmd -L-lcurl testDelegate.d
 
 $ ./testDelegate
 ./testDelegate: symbol lookup error:
 /opt/dmd/lib/libphobos2.so.0.66: undefined symbol:
 curl_version_info
 
 $ ldd ./testDelegate
 linux-vdso.so.1 =>  (0x00007fff2d4e8000)
 libcurl.so.4 => /opt/dmd/lib/libcurl.so.4 (0x00007f82fd060000)
 libdl.so.2 => /lib64/libdl.so.2 (0x00007f82fce58000)
 libphobos2.so.0.66 => /opt/dmd/lib/libphobos2.so.0.66
 (0x00007f82fc810000)
 libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f82fc5f0000)
 libm.so.6 => /lib64/libm.so.6 (0x00007f82fc2e8000)
 librt.so.1 => /lib64/librt.so.1 (0x00007f82fc0e0000)
 libc.so.6 => /lib64/libc.so.6 (0x00007f82fbd20000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f82fd288000)
 
 given executable is link with libcurl provided by dmd
 
 when i look into these curl lib they are any curl_version_info
 symbol
 

 

 curl_version_info
 
 while this symbol exist on libcurl provided by my fedora
 

        346: 0000000000023f20   140 FUNC    GLOBAL DEFAULT   11
 curl_version_info
You are probably using DMD provided dlang.org... That one has issues (curl) on Fedora. DMD built with my SPEC from https://www.gitorious.org/dejan-fedora/dejan-fedora does not have these problems as far as I know. -- http://dejan.lekic.org
May 26 2014
parent "bioinfornatics" <bioifornatics fedoraproject.org> writes:
On Monday, 26 May 2014 at 10:59:00 UTC, Dejan Lekic wrote:
 bioinfornatics wrote:

 Hi, after building and installing dmd i fail to use generated
 executable because they are an undefined symbol.
 
 
 $ /opt/dmd/bin/dmd -L-lcurl testDelegate.d
 
 $ ./testDelegate
 ./testDelegate: symbol lookup error:
 /opt/dmd/lib/libphobos2.so.0.66: undefined symbol:
 curl_version_info
 
 $ ldd ./testDelegate
 linux-vdso.so.1 =>  (0x00007fff2d4e8000)
 libcurl.so.4 => /opt/dmd/lib/libcurl.so.4 (0x00007f82fd060000)
 libdl.so.2 => /lib64/libdl.so.2 (0x00007f82fce58000)
 libphobos2.so.0.66 => /opt/dmd/lib/libphobos2.so.0.66
 (0x00007f82fc810000)
 libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f82fc5f0000)
 libm.so.6 => /lib64/libm.so.6 (0x00007f82fc2e8000)
 librt.so.1 => /lib64/librt.so.1 (0x00007f82fc0e0000)
 libc.so.6 => /lib64/libc.so.6 (0x00007f82fbd20000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f82fd288000)
 
 given executable is link with libcurl provided by dmd
 
 when i look into these curl lib they are any curl_version_info
 symbol
 

 curl_version_info
 

 curl_version_info
 
 while this symbol exist on libcurl provided by my fedora
 

        346: 0000000000023f20   140 FUNC    GLOBAL DEFAULT   11
 curl_version_info
You are probably using DMD provided dlang.org... That one has issues (curl) on Fedora. DMD built with my SPEC from https://www.gitorious.org/dejan-fedora/dejan-fedora does not have these problems as far as I know.
yes dejan your rpm works fine that is more to report it. it seem noone care about my issue. For me both my dmd and ldc works that was more to prevent bad experience to new users
May 26 2014