Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Status of Inline::CPP on Activeperl 5.10/Visual C++ 6

by mwah (Hermit)
on Sep 16, 2009 at 12:31 UTC ( #795589=perlquestion: print w/replies, xml ) Need Help??

mwah has asked for the wisdom of the Perl Monks concerning the following question:

Over two years or so ago, I tried to manage to install Neils Inline::CPP into Activeperl (5.8.x)

IIRC this worked, but some tests didn't complete (I didn't do much with it).

Inspired by the actual Inline::CPP threads, I tried (today)
to install this Module into (Active-)Perl 5.10.

After applying the usual patch (Line 44 of CPP.pm)
by hand (the same like I did six years ago the first
time ;-), the compilation went smooth so far, but, as
seen before, some test didn't complete. The error
is:

_ii_jj.xs(32) : error C2258: illegal pure syntax, must be '= 0' _ii_jj.xs(32) : error C2252: 'aa' : pure specifier can only be specifi +ed for functions

(for several times).

This has been a marked bug for five years.

My Question:
Does anybody have a fix for that problem or a clue for me where to look in order to help fixing it?

Or ist the combination "Activeperl 5.10" (built w/Visual C++ 6) and "Inline w/Visual C++ 6" considered obsolete?

Thanks and regards

mwa

Replies are listed 'Best First'.
Re: Status of Inline::CPP on Activeperl 5.10/Visual C++ 6
by almut (Canon) on Sep 16, 2009 at 13:31 UTC
    ... illegal pure syntax, must be '= 0'

    I'm no Windows gal, but IIRC, the issue with VC++ 6 is that it doesn't accept initialisations like:

    class X { static const int x = 99; // ... };

    VC6 is just too old / not standards-compliant. The workaround would be (I think) to initialise static const members outside of the class

    class X { static const int x; // ... }; const int X::x = 99;

    Good luck :)

      Correct.

      >cl /c test1.cpp Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for +80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. test1.cpp test1.cpp(2) : error C2258: illegal pure syntax, must be '= 0' test1.cpp(2) : error C2252: 'x' : pure specifier can only be specified + for functions >cl /c test2.cpp Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for +80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. test2.cpp >
      Thank you for your response. In spite of not
      making the test suite, I gave it (Inline::CPP) a try. First
      Program, as described in the Examples compiled,
      but segfaulted the perl core on program return with:
      Free to wrong pool 235e38 not b01f4.
      Another test, using an already compiled library and an include path for using the respective functions, like:
      use strict; use warnings; use Inline 'CPP'; use Inline CPP => Config => INC => '/I C:\\some\\tools\\' => LIBS => '/libpath:"C:\\some\\tools\\bin"' => LIBS => 'important.lib' ; my $n = ask_important_lib('question'); print $n; __END__ __CPP__ #include "important.h" int ask_important_lib(char* question) { SOMECLASS var(question); if( var.errorstatus() ) { printf("we got an error %d on question %s!\n", var.errorstatus(), +question); return -1; } return 1; }

      The above wouldn't even start to compile, nmake (1.5) will complain:

      ... makefile(878) : fatal error U1083: target macro '$(OBJECT)' expands t +o nothing ...

      So I throwed the towel. This seems to be completely non-workable on anything non-trivial C++ problem.

      BTW: I tried similar w/Ruby's RubyInline on
      Ruby 1.9 - also w/Visual C++ 6.

      Almost the same result. Some trivial things work,
      but anything referencing external include files
      or libs won't work (at least with Visual C++ 6, the
      system the actual Ruby 1.9.1 binary for win32 is built
      ).

      Thanks & regards

      mwa

Re: Status of Inline::CPP on Activeperl 5.10/Visual C++ 6
by syphilis (Bishop) on Sep 17, 2009 at 06:58 UTC
    If it's any use to you, Inline::CPP builds and tests fine with ActivePerl-5.10 and the MinGW compiler (which you can install by running ppm install MinGW). If you do try to build with MinGW, make sure you start with a fresh source installation - running 'nmake realclean' first is not enough.
    I use Parse-RecDescent-1.94 as there are problems with later versions of P::RD and Inline::CPP.

    Inline::CPP also builds and tests fine using Visual C++ 7.0 (on a perl-5.10.1 built using the same compiler), so I guess the problem must be specific to Visual C++ 6 - which I don't have.

    Cheers,
    Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://795589]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2021-05-16 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (151 votes). Check out past polls.

    Notices?