|
From: Robert W. L. <rw...@bu...> - 2012-10-29 14:56:29
|
Hi,
I tried swig for the first time this week and have spent a few days now banging my head against this problem. Hopefully someone can help out a newbie like myself. I've tried many variants, but my first attempt based on the documentation goes like the example below. Instead of me telling you everything I tried, I figure it would be better to start fresh from this point. As you can see, I included all the same gcc options in the wrapper compile as it takes to compile the object needed to make my C executable. I just eliminated the -o and added blatlib_wrap.c. I've tried this both on RedHat Linux and on Mac OS X 10.7. Below is the linux attempt.
Thanks,
Rob
blatlib>make
#Compiling the module
gcc -O -g -Wall -Wformat -Wimplicit -Wreturn-type -Wuninitialized -I../inc -I../../inc -I../../../inc -I../../../../inc -I../../../../../inc -c blatlib.c -o blatlib.o
#Compile the test executable
gcc -O -g -Wall -Wformat -Wimplicit -Wreturn-type -Wuninitialized -I../inc -I../../inc -I../../../inc -I../../../../inc -I../../../../../inc -o /user/rwleach/u2/bin/x86_64/testblatlib testblatlib.c blatlib.o ../lib/x86_64/jkOwnLib.a ../lib/x86_64/jkweb.a -pthread -lssl -lcrypto -lpng -lm
strip /user/rwleach/u2/bin/x86_64/testblatlib
#Create a swig interface for using this C library from perl
swig -perl -module blatlib blatlib.h
#Compile the swig wrapper
gcc -O -g -Wall -Wformat -Wimplicit -Wreturn-type -Wuninitialized -I../inc -I../../inc -I../../../inc -I../../../../inc -I../../../../../inc -I/usr/lib64/perl5/CORE -c blatlib.c blatlib_wrap.c
In file included from /usr/lib64/perl5/CORE/perl.h:4829,
from blatlib_wrap.c:731:
/usr/lib64/perl5/CORE/proto.h:690: error: expected declaration specifiers or ‘...’ before ‘off64_t’
/usr/lib64/perl5/CORE/proto.h:697: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Perl_do_sysseek’
/usr/lib64/perl5/CORE/proto.h:702: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Perl_do_tell’
/usr/lib64/perl5/CORE/proto.h:6014: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Perl_PerlIO_tell’
/usr/lib64/perl5/CORE/proto.h:6015: error: expected declaration specifiers or ‘...’ before ‘off64_t’
blatlib_wrap.c: In function ‘SWIG_Perl_ConvertPtrAndOwn’:
blatlib_wrap.c:1198: warning: value computed is not used
blatlib_wrap.c: In function ‘SWIG_Perl_MakePtr’:
blatlib_wrap.c:1225: warning: value computed is not used
blatlib_wrap.c: In function ‘_wrap_gfBioSeqClient’:
blatlib_wrap.c:1745: error: ‘bioSeq’ undeclared (first use in this function)
blatlib_wrap.c:1745: error: (Each undeclared identifier is reported only once
blatlib_wrap.c:1745: error: for each function it appears in.)
blatlib_wrap.c:1745: error: ‘arg4’ undeclared (first use in this function)
blatlib_wrap.c:1745: error: expected expression before ‘)’ token
blatlib_wrap.c:1807: error: expected expression before ‘)’ token
blatlib_wrap.c:1843: warning: implicit declaration of function ‘gfBioSeqClient’
blatlib_wrap.c: In function ‘_wrap_gfSingleClient’:
blatlib_wrap.c:1995: warning: implicit declaration of function ‘gfSingleClient’
blatlib_wrap.c: In function ‘_wrap_addToBioSeqListHead’:
blatlib_wrap.c:2032: error: ‘bioSeq’ undeclared (first use in this function)
blatlib_wrap.c:2032: error: ‘arg1’ undeclared (first use in this function)
blatlib_wrap.c:2032: error: expected expression before ‘)’ token
blatlib_wrap.c:2056: error: expected expression before ‘)’ token
blatlib_wrap.c:2072: warning: implicit declaration of function ‘addToBioSeqListHead’
blatlib_wrap.c: In function ‘_wrap_reverseBioSeq’:
blatlib_wrap.c:2091: error: ‘bioSeq’ undeclared (first use in this function)
blatlib_wrap.c:2091: error: ‘arg1’ undeclared (first use in this function)
blatlib_wrap.c:2091: error: expected expression before ‘)’ token
blatlib_wrap.c:2104: error: expected expression before ‘)’ token
blatlib_wrap.c:2105: warning: implicit declaration of function ‘reverseBioSeq’
blatlib_wrap.c: In function ‘boot_blatlib’:
blatlib_wrap.c:2402: warning: unused variable ‘items’
make: *** [gfStrClient.o] Error 1
|