Dear Monks,

on my continuing quest to bring the CORBA magic to Win32 I have taken to trying to build CORBA::ORBit v.0.4.7.

I am running ActivePerl v5.8.4 for MSWin32-x86-multi-thread, which is built using Microsoft Visual C++ 6.0. I reasoned that, in order to build this module, I should use MSVC++ too - although I have no prior experience with this program. I decided to give it a shot after numerous earlier aborted attempts using mingw gcc.

Anyway, so I unzip and untar the *.tar.gz for the module and start a new *.dll project in MSVC++. I add the C sources, the headers and the XS file to the project. I point MSVC++ to the right extra headers (i.e. those for orbit, the perl CORE headers and the glib headers).

I get a LOT of compiler errors, seemingly because for some reason both winsock2.h and winsock.h are imported. I work around this by telling <sys/socket.h> in the perl CORE headers to include winsock2.h instead of winsock.h (don't worry, I'll change it back as soon as I'm done).

Most compiler errors have gone away now. The ones remaining have me at the end of my wits, though. "cl.exe" seems to choke on the following code, and I can't see what's wrong with it:
#ifdef __cplusplus extern "C" { #endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" void newCONSTSUB(HV *stash, char *name, SV *sv); #ifdef __cplusplus } #endif /* Graham Barr's Function for creating a constant subroutine. * From op.c in perl5.005_03 */ void newCONSTSUB(HV *stash, char *name, SV *sv) { U32 oldhints = hints; HV *old_cop_stash = curcop->cop_stash; HV *old_curstash = curstash; line_t oldline = curcop->cop_line; curcop->cop_line = copline; hints &= ~HINT_BLOCK_SCOPE; if(stash) curstash = curcop->cop_stash = stash; newSUB( start_subparse(FALSE, 0), newSVOP(OP_CONST, 0, newSVpv(name,0)), newSVOP(OP_CONST, 0, &sv_no), /* SvPV(&sv_no) == "" -- +GMB */ newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv)) ); hints = oldhints; curcop->cop_stash = old_cop_stash; curstash = old_curstash; curcop->cop_line = oldline; }
I get the following errors:
c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +0) : error C2143: syntax error : missing ')' before '(' c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +0) : error C2143: syntax error : missing ')' before '(' c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +0) : error C2091: function returns function c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +0) : error C2091: function returns function c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +0) : error C2061: syntax error : identifier 'Perl_get_context' c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +0) : error C2059: syntax error : ';' c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +0) : error C2059: syntax error : ')' c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +9) : error C2143: syntax error : missing ')' before '(' c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +9) : error C2143: syntax error : missing ')' before '(' c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +9) : error C2091: function returns function c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +9) : error C2091: function returns function c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +9) : error C2061: syntax error : identifier 'Perl_get_context' c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +9) : error C2059: syntax error : ';' c:\documents and settings\rvosa\desktop\corba-orbit-0.4.7\constsub.c(1 +9) : error C2059: syntax error : ')'
I am completely stumped. As far as I can tell (which doesn't say much as I'm neither a C guru nor an MSVC++ guru) there's nothing wrong with the code. I built CORBA::ORBit straight from CPAN on OS X and linux and only with minor tweaks of the Makefile.PL on Cygwin.

Any ideas? Thanks!

In reply to XS build panic by rvosa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.