Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1262 Incomplete compilation command line

closed-duplicate
5
2012-08-05
2012-07-19
Anonymous
No

Hi,

i have no previous experience with SWIG and very little with C, but regarding the Java - C documentation (PDF and HTML versions) for the latest 2.0 release chapter '24.2.4 Compiling a dynamic module', i wasn't able to get it running: The commnads as stated in the docs:
$ swig -java example.i
$ gcc -c example_wrap.c -I/usr/java/include -I/usr/java/include/solaris
$ ld -G example_wrap.o -o libexample.so

For it to work i had to add the example.c files for compile and link, so the commands look like this:
swig -java example.i
gcc -c example_wrap.c example.c -I/usr/lib/jvm/java-6-openjdk/include -I/usr/lib/jvm/java-6-openjdk/include/linux
ld -G example_wrap.o example.o -o libexample.so

Best regards.
Javi

Discussion

  • William Fulton
    William Fulton
    2012-08-05

    • status: open --> closed-duplicate
     
  • William Fulton
    William Fulton
    2012-08-05

    Duplicate of 3545858