Skip to content

Instantly share code, notes, and snippets.

@bioinfornatics
Created February 24, 2012 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bioinfornatics/1895954 to your computer and use it in GitHub Desktop.
Save bioinfornatics/1895954 to your computer and use it in GitHub Desktop.
$ ldc2 -shared test.d -soname test.so -g
$ gcc test.c -L. -ltest -otest -g
$ LD_LIBRARY_PATH=`pwd`gdb ./test
./test: error while loading shared libraries: test.so: cannot open shared object file: No such file or directory
$ LD_LIBRARY_PATH=`pwd` gdb ./test
(gdb) b 5
Breakpoint 1 at 0x400608: file test.c, line 5.
(gdb) r
Starting program: /home/jonathan/gist1895766-f0e685b77e79cb33e4bf55282f991e627ec703cb/test
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Breakpoint 1, main () at test.c:5
5 test_func();
(gdb) l
1 void test_func();
2
3 int main()
4 {
5 test_func();
6 return 0;
7 }
(gdb) s
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7dfbafa in std.stdio.__T7writelnTAyaZ.writeln() (_param_0=...) at /usr/include/d/std/stdio.d:1550
1550 enforce(fprintf(.stdout.p.handle, "%.*s\n",
@timowest
Copy link

timowest commented Apr 7, 2012

Did you get this fixed at some point? I have similar issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment