2013-02-08 146 views
0

我正在开发一个需要Event :: Lib的Perl项目。我在MacOS 10.7上,并且正在运行Citrus Perl而不是系统Perl。我从源码安装libevent,它编译得很好。但是,当我去安装Event :: Lib时,我遇到了一些错误:在Mac OS X上安装CitrusPerl中的Event :: Lib安装10.7

cp Lib/Event/Lib.pm blib/lib/Event/Lib.pm 
Skip blib/lib/Event/Lib.pm (unchanged) 
/Users/username/code/CitrusPerl/bin/perl /Users/username/code/CitrusPerl/lib/ExtUtils/xsubpp -typemap /Users/username/code/CitrusPerl/lib/ExtUtils/typemap -typemap typemap Lib.xs > Lib.xsc && mv Lib.xsc Lib.c 
gcc -c -I/usr/local/include -fno-common -DPERL_DARWIN -no-cpp-precomp -arch i386 -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/gcc -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/gcc -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks -mmacosx-version-min=10.6 -DUSE_SITECUSTOMIZE -Duselargefiles -DPERL_RELOCATABLE_INCPUSH -fno-merge-constants -fno-strict-aliasing -pipe -fstack-protector -O3 -DVERSION=\"1.03\" -DXS_VERSION=\"1.03\" "-I/Users/username/code/CitrusPerl/lib/CORE" -DHAVE_CONFIG_H Lib.c 
Lib.xs: In function ‘boot_Event__Lib’: 
Lib.xs:275: error: ‘LOG_LEVEL’ undeclared (first use in this function) 
Lib.xs:275: error: (Each undeclared identifier is reported only once 
Lib.xs:275: error: for each function it appears in.) 
make: *** [Lib.o] Error 1 

有没有人有什么想法接下来要做什么?

编辑:尝试一些“O的conf”选项后:

cpan[1]> o conf makepl_arg "INC=-I/usr/local/include LIBS=-L/usr/local/lib -levent"                
    makepl_arg   [INC=-I/usr/local/include LIBS=-L/usr/local/lib -levent] 
Your /Users/username/code/CitrusPerl/vendor/lib/CPAN/Config.pm file 
is not writable. I will attempt to write your configuration to 
/Users/username/.cpan/CPAN/MyConfig.pm instead. 

Old configuration file /Users/username/.cpan/CPAN/MyConfig.pm 
    moved to /Users/username/.cpan/CPAN/MyConfig.pm.bak 
commit: wrote '/Users/username/.cpan/CPAN/MyConfig.pm' 

cpan[2]> install Event::Lib                              
Reading '/Users/username/code/CitrusPerl/cpan/Metadata' 
    Database was generated on Thu, 07 Feb 2013 21:53:02 GMT 
Fetching with LWP: 
http://www.perl.org/CPAN/authors/01mailrc.txt.gz 
Reading '/Users/username/code/CitrusPerl/cpan/sources/authors/01mailrc.txt.gz' 
............................................................................DONE 
Fetching with LWP: 
http://www.perl.org/CPAN/modules/02packages.details.txt.gz 
Reading '/Users/username/code/CitrusPerl/cpan/sources/modules/02packages.details.txt.gz' 
    Database was generated on Thu, 14 Feb 2013 15:41:03 GMT 
............................................................................DONE 
Fetching with LWP: 
http://www.perl.org/CPAN/modules/03modlist.data.gz 
Reading '/Users/username/code/CitrusPerl/cpan/sources/modules/03modlist.data.gz' 
............................................................................DONE 
Writing /Users/username/code/CitrusPerl/cpan/Metadata 
Running install for module 'Event::Lib' 
Running make for V/VP/VPARSEVAL/Event-Lib-1.03.tar.gz 
Fetching with LWP: 
http://www.perl.org/CPAN/authors/id/V/VP/VPARSEVAL/Event-Lib-1.03.tar.gz 
Checksum for /Users/username/code/CitrusPerl/cpan/sources/authors/id/V/VP/VPARSEVAL/Event-Lib-1.03.tar.gz ok 
Scanning cache /Users/username/code/CitrusPerl/cpan/build for sizes 
............................................................................DONE 

    CPAN.pm: Building V/VP/VPARSEVAL/Event-Lib-1.03.tar.gz 

Checking existance of libevent...ld: warning: directory not found for option '-L/sw/lib' 
ld: warning: directory not found for option '-L/opt/local/lib' 
yes 
Checking capabilities... 
    event_set_log_callback...no 
    event_priority_init...no 
Additional defines: 

Checking if your kit is complete... 
Looks good 
Writing Makefile for Event::Lib 
Writing MYMETA.yml and MYMETA.json 
cp Lib/Event/Lib.pm blib/lib/Event/Lib.pm 
Skip blib/lib/Event/Lib.pm (unchanged) 
/Users/username/code/CitrusPerl/bin/perl /Users/username/code/CitrusPerl/lib/ExtUtils/xsubpp -typemap /Users/username/code/CitrusPerl/lib/ExtUtils/typemap -typemap typemap Lib.xs > Lib.xsc && mv Lib.xsc Lib.c 
gcc -c -I/usr/local/include -fno-common -DPERL_DARWIN -no-cpp-precomp -arch i386 -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/gcc -B/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/gcc -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks -mmacosx-version-min=10.6 -DUSE_SITECUSTOMIZE -Duselargefiles -DPERL_RELOCATABLE_INCPUSH -fno-merge-constants -fno-strict-aliasing -pipe -fstack-protector -O3 -DVERSION=\"1.03\" -DXS_VERSION=\"1.03\" "-I/Users/username/code/CitrusPerl/lib/CORE" -DHAVE_CONFIG_H Lib.c 
Lib.xs: In function ‘boot_Event__Lib’: 
Lib.xs:275: error: ‘LOG_LEVEL’ undeclared (first use in this function) 
Lib.xs:275: error: (Each undeclared identifier is reported only once 
Lib.xs:275: error: for each function it appears in.) 
make: *** [Lib.o] Error 1 
    VPARSEVAL/Event-Lib-1.03.tar.gz 
    /usr/bin/make -- NOT OK 
Running make test 
    Can't test without successful make 
Running make install 
    Make had returned bad status, install seems impossible 
Failed during this command: 
VPARSEVAL/Event-Lib-1.03.tar.gz    : make NO 

回答

0

我能得到这个在10分钟左右的时间工作。

然后:

  • 酿造安装了libevent
  • perlbrew安装perl-5.16.0
  • perlbrew开关的Perl 5.16.0
  • 的perl -MCPAN -e“安装事件::库”

我觉得上面的是提供一个合适的开发环境,您可以切换了最好的实用程序; IE可以切换飞行的Perl版本。另外他们不会影响你的本地系统。无论如何,如果你决定不使用上述,你的特定错误看起来是关于一个缺少的头文件。我会断言libevent头文件确实在/ usr/local/include中。

祝你好运。

+0

仅供参考 - 您可能不需要使用Perl Brew。尝试首先通过自制软件安装libevent。 – patbaker82 2013-02-13 07:21:53

+0

我想使用CitrusPerl。我正在运行Padre,并且CitrusPerl将与Wx库小部件一起安装。 我试着从brew中安装libevent,并且它安装得很好。 Event :: Lib安装时出现同样的错误。 – 2013-02-13 17:38:04

+0

如果你将libevent建立为一个通用库,你也许会有更好的运气。 #酿造卸载了libevent #酿造安装了libevent --universal CPAN: ØCONF makepl_arg “INC = -I在/ usr /本地/包括LIBS = -L在/ usr/local/lib目录-levent” 安装事件: :Lib – patbaker82 2013-02-14 02:57:40