3

アクティブな perl 5.14.2 を使用しています。ここでは、Inline::C を使用して perl コードで Windows C ライブラリを使用しようとしています。

use strict;

use Inline C => DATA =>
           CCFLAGS => '-std:C99 -Tx86-coff -Zi -Ob1 -fp:precise -W1 -Gd -Ze -Go -D_USER_SPACE_' =>
           INC  => '"-ID:\test\incl"' =>
           LIBS => '"-LD:\test\lib" -llib1 -llib2 -llib3 -llib4';


test();

__END__
__C__

#include <incl/hd1.h>

#include <stdio.h>

#define __STDC_FORMAT_MACROS
#include <inttypes.h>

void test(void) {
.........

スクリプトを実行しようとしているときに、以下のエラーで失敗します

Warning. No Inline C functions bound to Perl in .\test.pl
Check your C function definition(s) for Inline compatibility


Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        C:\Perl5.14\bin\perl.exe C:\Perl5.14\lib\ExtUtils\xsubpp  -typemap "C:\Perl5.14\lib\ExtUtils\typemap"  test_pl_7fbb.xs > test_pl_7fbb.xsc && C:\Perl5.14\bin\perl.exe -M
ExtUtils::Command -e "mv" -- test_pl_7fbb.xsc test_pl_7fbb.c
        cl -c  -I"D:/test" "-ID:\test\incl"  -std:C99 -Tx86-coff -Zi -Ob1 -fp:precise -W1 -Gd -Ze -Go -D_USER_SPACE_ -MD -Zi -DNDEBUG -O1    -DVERSIO
N=\"0.00\"  -DXS_VERSION=\"0.00\"  "-IC:\Perl5.14\lib\CORE"   test_pl_7fbb.c
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\cl.EXE"' : return code '0xc0000135'
Stop.

A problem was encountered while attempting to compile and install your Inline
C code. The command that failed was:
  C:\PROGRA~2\MICROS~1.0\VC\bin\nmake.exe > out.make 2>&1

The build directory was:
D:\test\_Inline\build\test_pl_7fbb

To debug the problem, cd to the build directory, and inspect the output files.

 at .\test.pl line 0
        ...propagated at C:/Perl5.14/site/lib/Inline/C.pm line 772.
INIT failed--call queue aborted.
PS D:\cmapl_test> perl -v

This is perl 5, version 14, subversion 2 (v5.14.2) built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2011, Larry Wall

Binary build 1402 [295342] provided by ActiveState http://www.ActiveState.com
Built Oct  7 2011 15:49:44

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

次のコマンドを使用して test_pl_7fbb.c ファイルをビルドしようとしました。

cl -c  "-ID:\test" "-ID:\test\include"  -std:C99 -Tx86-coff -Zi -Ob1 -fp:precise -W1 -
Gd -Ze -Go -D_USER_SPACE_  -MD -Zi -DNDEBUG -O1    "-DVERSION=0.00"  
"-DXS_VERSION=0.00"  "-IC:\Perl5.14\lib\CORE"   test_pl_7fbb.c

エラーなく完了しました。

コンパイル中にインラインで使用されるオプション -I"D:/test" が問題を引き起こしていると思います。

これについて何か助けてくれてありがとう。

4

2 に答える 2

1

ActivePerl の PPM サーバーから MinGW をインストールしてみてください。おそらく、インストールされたモジュールの多くを再コンパイルして動作させる必要がありますが、Inline::C のようなものを適切に動作させると確信しています。

于 2013-06-07T12:26:45.153 に答える