slavapestov/factor — pull request #991 by bjourne (2014-02-10 02:15:25+00:00)
Title: debugger: show what dlerror outputs when undefined-symbol-error occurs

This is a possible fix for #986. It adds one extra line of output to the error message that is shown when an alien function call fails. Previously, when you wanted to use the chipmunk library without having the correct library:

```
Cannot resolve C library function
Symbol: cpInitChipmunk
Library: DLL" libchipmunk.so"
You are probably missing a library or the library path is wrong.
See http://concatenative.org/wiki/view/Factor/Requirements
```
With the patch:
```
Cannot resolve C library function
Symbol: cpInitChipmunk
Library: DLL" libchipmunk.so"
Dlerror: libchipmunk.so: cannot open shared object file: No such file or directory
You might be missing a library or the library path is wrong.
See http://concatenative.org/wiki/view/Factor/Requirements
```
If you try to call a function that doesn't exist in the lib (but the lib itself works):
```
IN: scratchpad pcre_i_dont_exist
Cannot resolve C library function
Symbol: pcre_i_dont_exist
Library: DLL" /lib/x86_64-linux-gnu/libpcre.so.3"
Dlerror: /lib/x86_64-linux-gnu/libpcre.so.3: undefined symbol: pcre_i_dont_exist
You might be missing a library or the library path is wrong.
See http://concatenative.org/wiki/view/Factor/Requirements
```
What is shown on the Dlerror line is highly system dependent. And could even be translated according to the locale on some platforms. But hopefully showing it can give the user some clue on why Factor complains and how to troubleshoot it further.