You haven't figured out the basic concept. Start reading 
here: http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

Basically all those -lsomethings are libgsl.so, libm.so etc. Now you will 
need to make your main program and link it against your libEx.so with -lEx 
in the linking command. Or then start using the generated libEx.so with 
julia ccall like you tried in the first post. 

On Wednesday, February 3, 2016 at 7:50:25 PM UTC+2, Chris Rackauckas wrote:
>
> Thanks for the replies. I mixed the compile commands from here 
> <http://stackoverflow.com/questions/14884126/build-so-file-from-c-file-using-gcc-command-line>
>  with 
> the information on the libraries to link 
> <https://www.gnu.org/software/gsl/manual/html_node/Linking-programs-with-the-library.html#Linking-programs-with-the-library>
>  from 
> the GSL site to make the following command:
>
> gcc -Wall -g -shared -o libEx.so -lgsl -lgslcblas -lm -fPIC example.c
>
> However, when I ./libEx.so I get a segfault. So I opened it in gdb and ran 
> it to get:
>
> (gdb) run
> Starting program: /home/crackauc/Public/libEx.so 
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000000001 in ?? ()
>
>
> What does that error even mean? Since the object works and the shared 
> library doesn't. I assume that I compiled it wrong.
>
>

Reply via email to