Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Can't compile XS, getting "strcmp" error

by MrNobo1024 (Hermit)
on May 12, 2001 at 02:22 UTC ( #79856=perlquestion: print w/replies, xml ) Need Help??
MrNobo1024 has asked for the wisdom of the Perl Monks concerning the following question:

I've been experimenting with creating XS modules, but I can't get it to work. When I run nmake, it says
gcc -c -O1 -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCR +YP T -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX -O +1 -MD -DND EBUG -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -IC:\PERL\lib\CORE + xstest.c xstest.c: In function `boot_xstest': xstest.c:37: incompatible type for argument 1 of `strcmp' NMAKE : fatal error U1077: 'GCC' : return code '0x1' Stop.
Is there any way to fix this problem? I'm using ActivePerl 5.6.1 and MinGW 2.95.2.

Replies are listed 'Best First'.
Re: Can't compile XS, getting "strcmp" error
by Anonymous Monk on May 12, 2001 at 04:57 UTC
Re: Can't compile XS, getting "strcmp" error
by AgentM (Curate) on May 12, 2001 at 02:50 UTC
    Ensure that xstest.c at line 37 contains a call to strcmp where the first argument is a char*. It's rather self-explanatory. If you need additional help, you need to post the relevant piece of code.
    AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.
      Actually xstest.c dosen't call strcmp at all. The relevant code is

      xstest.xs:

      #include "EXTERN.h" #include "perl.h" #include "XSUB.h" MODULE = xstest PACKAGE = xstest void hello() CODE: printf("Hello, world!\n");
      xstest.c:
      /* * This file was generated automatically by xsubpp version 1.9508 from + the * contents of xstest.xs. Do not edit this file, edit xstest.xs instea +d. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "xstest.xs" #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #line 16 "xstest.c" XS(XS_xstest_hello) { dXSARGS; if (items != 0) Perl_croak(aTHX_ "Usage: xstest::hello()"); { #line 11 "xstest.xs" printf("Hello, world!\n"); #line 25 "xstest.c" } XSRETURN_EMPTY; } #ifdef __cplusplus extern "C" #endif XS(boot_xstest) { dXSARGS; char* file = __FILE__; XS_VERSION_BOOTCHECK ; newXS("xstest::hello", XS_xstest_hello, file); XSRETURN_YES; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://79856]
Approved by root
help
Chatterbox?
[erix]: didn't Sybase have pretty good auditing? :) (this is a vague memory)
[erix]: (culprits often are upstream of db of course)
[Corion]: Ah, how I missed it. After some years, I revisit slashdot on a click-bait link, and it provides the usual humor instantly: "I didn't know Drupal had rules for sex. It must be a plug-in"
[Corion]: erix: This is not for sybase, but for the input data files, resp. their contents.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2017-03-28 09:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (328 votes). Check out past polls.