Re: Linking Trouble (Linux)

2013-09-30 Thread Craig Dillabaugh

On Sunday, 29 September 2013 at 14:16:21 UTC, 1100110 wrote:

https://xkcd.com/979/

Please.  You are somebodies hero.


Did you actually run into the same problem?  If so, glad I could 
help.





Re: Linking Trouble (Linux)

2013-09-29 Thread 1100110

https://xkcd.com/979/

Please.  You are somebodies hero.


Re: Linking Trouble (Linux)

2013-09-13 Thread Craig Dillabaugh

On Thursday, 12 September 2013 at 20:47:46 UTC, Craig Dillabaugh
wrote:
clip


For anyone who runs into a similar problem using DUB the
following package.json files solves the problem:

{
name: vibe,
description: My first vibe project.,
homepage: http://example.org;,
copyright: Me,
authors: [
Craig Dillabaugh
],
dependencies: {
vibe-d: ~master
},
libs: [dl, z]
}


Hopefully starting a thread on a forum and then repeatedly
answering yourself isn't a sign of insanity, but I've found the
ultimate source of my problems and wanted to post back here in
case it might help someone else (myself?) in the future.

Anyway my suggested hacks above got my D programs to compile, but
when I tried to run anything, I would get seg faults along the
following lines:

(gdb) backtrace
#0  0x004547b9 in std.stdio.__T7writelnTAyaZ.writeln() ()
#1  0x00454301 in D main ()
#2  0x00460958 in rt.dmain2._d_run_main() ()
#3  0x0046048a in rt.dmain2._d_run_main() ()
#4  0x004609a8 in rt.dmain2._d_run_main() ()
#5  0x0046048a in rt.dmain2._d_run_main() ()
#6  0x00460446 in _d_run_main ()
#7  0x00460293 in main ()

It seems the source of my troubles was a broken binutils install
by openSuse. So I re-installed binutils and now everything purrs
along.

Thanks to everyone for your help :o)



Re: Linking Trouble (Linux)

2013-09-12 Thread Craig Dillabaugh

On Thursday, 12 September 2013 at 19:46:21 UTC, Craig Dillabaugh
wrote:
I just upgraded my Linux distro (openSuse) and now when trying 
to

compile a project with dub I am getting linking errors.

Compilation goes OK until the linking stage, when I get the
following:

Linking...
dmd -of/home/craig/cloud/vibe-tiles/vibe
/home/craig/cloud/vibe-tiles/temp.o -L-levent_pthreads -L-levent
-L-lssl -L-lcrypto -g


clip


Strangely, libdl.so.2 and libz.so.1 are both there and libcrypto
is linked to them.


clip


Craig


OK, so I solved my compilation problem by passing the following
as the linker command (added -L-ldl and -L-lz):

dmd -of/home/craig/cloud/vibe-tiles/vibe
/home/craig/cloud/vibe-tiles/temp.o -L-levent_pthreads -L-levent
-L-lssl -L-ldl -L-lz -L-lcrypto -g

How the GCC linker decides which libraries I need to explicitly
specify is indeed a mystery to me.

Craig


Linking Trouble (Linux)

2013-09-12 Thread Craig Dillabaugh

I just upgraded my Linux distro (openSuse) and now when trying to
compile a project with dub I am getting linking errors.

Compilation goes OK until the linking stage, when I get the
following:

Linking...
dmd -of/home/craig/cloud/vibe-tiles/vibe
/home/craig/cloud/vibe-tiles/temp.o -L-levent_pthreads -L-levent
-L-lssl -L-lcrypto -g
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
warning: libdl.so.2, needed by /usr/lib64/libcrypto.so, not found
(try using -rpath or -rpath-link)
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
warning: libz.so.1, needed by /usr/lib64/libcrypto.so, not found
(try using -rpath or -rpath-link)
/usr/lib64/libcrypto.so: undefined reference to
`dlopen@GLIBC_2.2.5'
/usr/lib64/libcrypto.so: undefined reference to
`dlerror@GLIBC_2.2.5'
/usr/lib64/libcrypto.so: undefined reference to
`dlclose@GLIBC_2.2.5'
/usr/lib64/libcrypto.so: undefined reference to
`dlsym@GLIBC_2.2.5'
/usr/lib64/libcrypto.so: undefined reference to
`dladdr@GLIBC_2.2.5'

Strangely, libdl.so.2 and libz.so.1 are both there and libcrypto
is linked to them.

$ ldd /usr/lib64/libcrypto.so
 linux-vdso.so.1 (0x7fff7d52)
 libdl.so.2 = /lib64/libdl.so.2 (0x7f3b2ef98000)
 libz.so.1 = /lib64/libz.so.1 (0x7f3b2ed8)
 libc.so.6 = /lib64/libc.so.6 (0x7f3b2e9d)
 /lib64/ld-linux-x86-64.so.2 (0x7f3b2f5a8000)

I've surfed around quite a bit and can't seem to find anything.
I solved a similar problem in the past by reinstalling glibc, but
that hasn't helped in this case. Any hints on where to look would
be appreciated.

Craig


Re: Linking Trouble (Linux)

2013-09-12 Thread Craig Dillabaugh

On Thursday, 12 September 2013 at 20:26:29 UTC, Craig Dillabaugh
wrote:

On Thursday, 12 September 2013 at 19:46:21 UTC, Craig Dillabaugh
wrote:
I just upgraded my Linux distro (openSuse) and now when trying 
to

compile a project with dub I am getting linking errors.

Compilation goes OK until the linking stage, when I get the
following:

Linking...
dmd -of/home/craig/cloud/vibe-tiles/vibe
/home/craig/cloud/vibe-tiles/temp.o -L-levent_pthreads 
-L-levent

-L-lssl -L-lcrypto -g


clip


Strangely, libdl.so.2 and libz.so.1 are both there and 
libcrypto

is linked to them.


clip


Craig


OK, so I solved my compilation problem by passing the following
as the linker command (added -L-ldl and -L-lz):

dmd -of/home/craig/cloud/vibe-tiles/vibe
/home/craig/cloud/vibe-tiles/temp.o -L-levent_pthreads -L-levent
-L-lssl -L-ldl -L-lz -L-lcrypto -g

How the GCC linker decides which libraries I need to explicitly
specify is indeed a mystery to me.

Craig


For anyone who runs into a similar problem using DUB the
following package.json files solves the problem:

{
name: vibe,
description: My first vibe project.,
homepage: http://example.org;,
copyright: Me,
authors: [
Craig Dillabaugh
],
dependencies: {
vibe-d: ~master
},
libs: [dl, z]
}