holandes777 has asked for the wisdom of the Perl Monks concerning the following question:
-rw-r--r-- 1 root root 1413 Nov 19 18:04 1 -rw-r--r-- 1 root root 867 Nov 19 18:30 ccc.pl -rw-r--r-- 1 root root 520 Oct 28 07:38 cc.pl -rw-r--r-- 1 root root 859 Oct 28 07:38 c.pl -rw-r--r-- 1 root root 663 Oct 28 08:12 GET_in_C.c -rwxr-xr-x 1 root root 33644 Oct 28 08:49 hasp_hl.h -rwxr-xr-x 1 root root 1606 Oct 28 07:38 hasp_vcode.h drwxr-xr-x 4 root root 4096 Oct 28 08:25 _Inline -rwxr-xr-x 1 root root 599778 Oct 28 07:38 libhasp_linux.a <--- this + is the library it says it cannot find in out.Makefile_PL -rwxr-xr-x 1 root root 412 Oct 28 07:38 readme.txt
my $kk = kk(); print "perl kk=$kk\n"; use Inline C => Config => LIBS => '-libhasp_linux.a'; use Inline C => <<'END_OF_C_CODE'; #include <stdio.h> #include <stdlib.h> #include <string.h> #include <hasp_hl.h> #include <hasp_vcode.h> int kk () { hasp_status_t status; hasp_handle_t handle; int i; char filename[] = "prg"; printf("start : "); status = hasp_login(HASP_PROGNUM_DEFAULT_FID, (hasp_vendor_code_t *)vendor_code, &handle); switch (status) { case HASP_STATUS_OK: printf("OK\n"); hasp_logout(handle); return(1); break; default: printf("BAD\n"); return(0); } END_OF_C_CODE
[root@FC4-Casinfo perltestP]# perl ccc.pl /usr/bin/perl /usr/lib/perl5/5.8.6/ExtUtils/xsubpp -typemap /usr/lib/ +perl5/5.8.6/ExtUtils/typemap ccc_pl_ae85.xs > ccc_pl_ae85.xsc && mv + ccc_pl_ae85.xsc ccc_pl_ae85.c gcc -c -I/HASP/perltestP -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno- +strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FIL +E_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wp,-D_FORTIFY_SOUR +CE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unw +ind-tables -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" -fPIC "-I/usr/l +ib/perl5/5.8.6/i386-linux-thread-multi/CORE" ccc_pl_ae85.c ccc_pl_ae85.c: In function âkkâ: ccc_pl_ae85.c:44: error: static declaration of âXS_main_kkâ follows no +n-static declaration ccc_pl_ae85.c:42: error: previous declaration of âXS_main_kkâ was here ccc_pl_ae85.c:63: error: static declaration of âboot_ccc_pl_ae85â foll +ows non-static declaration ccc_pl_ae85.c:61: error: previous declaration of âboot_ccc_pl_ae85â wa +s here ccc_pl_ae85.c:71: error: syntax error at end of input make: *** [ccc_pl_ae85.o] Error 1 A problem was encountered while attempting to compile and install your + Inline C code. The command that failed was: make > out.make 2>&1 The build directory was:<BR> /HASP/perltestP/_Inline/build/ccc_pl_ae85 To debug the problem, cd to the build directory, and inspect the outpu +t files. at ccc.pl line 6 BEGIN failed--compilation aborted at ccc.pl line 33. [root@FC4-Casinfo perltestP]#
[root@FC4-Casinfo ccc_pl_ae85]# ls -l total 56 drwxr-xr-x 8 root root 4096 Nov 12 16:44 blib -rw-r--r-- 1 root root 1576 Nov 19 18:04 ccc_pl_ae85.c -rw-r--r-- 1 root root 870 Nov 19 18:04 ccc_pl_ae85.xs -rw-r--r-- 1 root root 1073 Nov 19 18:04 INLINE.h -rw-r--r-- 1 root root 26043 Nov 19 18:04 Makefile -rw-r--r-- 1 root root 364 Nov 19 18:04 Makefile.PL -rw-r--r-- 1 root root 1054 Nov 19 18:04 out.make -rw-r--r-- 1 root root 97 Nov 19 18:04 out.Makefile_PL -rw-r--r-- 1 root root 0 Oct 28 14:22 pm_to_blib [root@FC4-Casinfo ccc_pl_ae85]#
[root@FC4-Casinfo ccc_pl_ae85]# cat out.make /usr/bin/perl /usr/lib/perl5/5.8.6/ExtUtils/xsubpp -typemap /usr/lib/ +perl5/5.8.6/ExtUtils/typemap ccc_pl_ae85.xs > ccc_pl_ae85.xsc && mv + ccc_pl_ae85.xsc ccc_pl_ae85.c gcc -c -I/HASP/perltestP -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno- +strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FIL +E_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wp,-D_FORTIFY_SOUR +CE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unw +ind-tables -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" -fPIC "-I/usr/l +ib/perl5/5.8.6/i386-linux-thread-multi/CORE" ccc_pl_ae85.c ccc_pl_ae85.c: In function âkkâ: ccc_pl_ae85.c:44: error: static declaration of âXS_main_kkâ follows no +n-static declaration ccc_pl_ae85.c:42: error: previous declaration of âXS_main_kkâ was here ccc_pl_ae85.c:63: error: static declaration of âboot_ccc_pl_ae85â foll +ows non-static declaration ccc_pl_ae85.c:61: error: previous declaration of âboot_ccc_pl_ae85â wa +s here ccc_pl_ae85.c:71: error: syntax error at end of input make: *** [ccc_pl_ae85.o] Error 1 [root@FC4-Casinfo ccc_pl_ae85]#
[root@FC4-Casinfo ccc_pl_ae85]# cat out.Makefile_PL Note (probably harmless): No library found for -libhasp_linux.a Writing Makefile for ccc_pl_ae85 [root@FC4-Casinfo ccc_pl_ae85]# (note that the library is sitting in the same place as the ccc.pl)
[root@FC4-Casinfo ccc_pl_ae85]# cat ccc_pl_ae85.c /* * This file was generated automatically by xsubpp version 1.9508 from + the * contents of ccc_pl_ae85.xs. Do not edit this file, edit ccc_pl_ae85 +.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "ccc_pl_ae85.xs" #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "INLINE.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <hasp_hl.h> #include <hasp_vcode.h> int kk () { hasp_status_t status; hasp_handle_t handle; int i; char filename[] = "prg"; printf("start : "); status = hasp_login(HASP_PROGNUM_DEFAULT_FID, (hasp_vendor_code_t *)vendor_code, &handle); switch (status) { case HASP_STATUS_OK: printf("OK\n"); // i = system("./kk"); # these are used to launch a compile +d perl pgm // printf("i=%d\n",i); hasp_logout(handle); return(1); break; default: printf("BAD\n"); return(0); } #line 42 "ccc_pl_ae85.c" XS(XS_main_kk); /* prototype to pass -Wmissing-prototypes */ XS(XS_main_kk) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: main::kk()"); { int RETVAL; dXSTARG; RETVAL = kk(); XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } #ifdef __cplusplus extern "C" #endif XS(boot_ccc_pl_ae85); /* prototype to pass -Wmissing-prototypes */ XS(boot_ccc_pl_ae85) { dXSARGS; char* file = __FILE__; XS_VERSION_BOOTCHECK ; newXS("main::kk", XS_main_kk, file); XSRETURN_YES; }
[root@FC4-Casinfo ccc_pl_ae85]# cat ccc_pl_ae85.xs #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "INLINE.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <hasp_hl.h> #include <hasp_vcode.h> int kk () { hasp_status_t status; hasp_handle_t handle; int i; char filename[] = "prg"; printf("start : "); status = hasp_login(HASP_PROGNUM_DEFAULT_FID, (hasp_vendor_code_t *)vendor_code, &handle); switch (status) { case HASP_STATUS_OK: printf("OK\n"); // i = system("./kk"); # these are used to launch a compile +d perl pgm // printf("i=%d\n",i); hasp_logout(handle); return(1); break; default: printf("BAD\n"); return(0); } MODULE = ccc_pl_ae85 PACKAGE = main PROTOTYPES: DISABLE int kk ()
[root@FC4-Casinfo ccc_pl_ae85]# cat INLINE.h #define Inline_Stack_Vars dXSARGS #define Inline_Stack_Items items #define Inline_Stack_Item(x) ST(x) #define Inline_Stack_Reset sp = mark #define Inline_Stack_Push(x) XPUSHs(x) #define Inline_Stack_Done PUTBACK #define Inline_Stack_Return(x) XSRETURN(x) #define Inline_Stack_Void XSRETURN(0) #define INLINE_STACK_VARS Inline_Stack_Vars #define INLINE_STACK_ITEMS Inline_Stack_Items #define INLINE_STACK_ITEM(x) Inline_Stack_Item(x) #define INLINE_STACK_RESET Inline_Stack_Reset #define INLINE_STACK_PUSH(x) Inline_Stack_Push(x) #define INLINE_STACK_DONE Inline_Stack_Done #define INLINE_STACK_RETURN(x) Inline_Stack_Return(x) #define INLINE_STACK_VOID Inline_Stack_Void #define inline_stack_vars Inline_Stack_Vars #define inline_stack_items Inline_Stack_Items #define inline_stack_item(x) Inline_Stack_Item(x) #define inline_stack_reset Inline_Stack_Reset #define inline_stack_push(x) Inline_Stack_Push(x) #define inline_stack_done Inline_Stack_Done #define inline_stack_return(x) Inline_Stack_Return(x) #define inline_stack_void Inline_Stack_Void [root@FC4-Casinfo ccc_pl_ae85]#
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inline::C produces compilation errors
by syphilis (Archbishop) on Nov 20, 2007 at 01:00 UTC | |
by holandes777 (Scribe) on Nov 20, 2007 at 21:54 UTC | |
by syphilis (Archbishop) on Nov 20, 2007 at 23:24 UTC | |
by holandes777 (Scribe) on Nov 22, 2007 at 16:28 UTC | |
by syphilis (Archbishop) on Nov 22, 2007 at 22:32 UTC | |
| |
|
Re: Inline::C produces compilation errors
by ikegami (Patriarch) on Nov 20, 2007 at 00:58 UTC | |
by holandes777 (Scribe) on Nov 20, 2007 at 21:50 UTC |