perl-5.14.0在新版gcc中編譯不通過解決辦法

來源:互聯網
上載者:User

標籤:

1?? ? 由於在新版本中GCC把C99中的標準庫分成了libc和libm兩個部分,libm中包含一些數學庫等,如果要用到libm時,必須加上-lm選項

在解壓Configure之後,再在Makefile中,LDFLAGS 和 CLDFLAGS兩個參數後面加上 -lm即可解決問題

2?? ? 參考:http://serverfault.com/questions/145288/make-error-when-compiling-perl-5-12-1-rhel-5-5

? ? ?修改 dist/IO/poll.h:將 #include 修改為 #include

3?? ? 參考:http://blog.163.com/zhangliye_2009/blog/static/1223120282013518104148904/

? ? ?在Makefile 中,LDFLAGS 和 CLDFLAGS兩個參數後面加上 -lrt?

相關報錯資訊:

1

cc -fstack-protector -L/usr/lib64 -o miniperl \????????????? gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o?? \??????????? miniperlmain.o opmini.o perlmini.opp.o: In function `Perl_pp_int‘:pp.c:(.text+0x9151): undefined reference to `floor‘pp.c:(.text+0x9171): undefined reference to `ceil‘pp.o: In function `Perl_pp_sin‘:pp.c:(.text+0x944d): undefined reference to `sin‘pp.o: In function `Perl_pp_atan2‘:pp.c:(.text+0xc2c3): undefined reference to `atan2‘pp.o: In function `Perl_pp_modulo‘:pp.c:(.text+0xdc71): undefined reference to `floor‘pp.c:(.text+0xde3d): undefined reference to `fmod‘pp.c:(.text+0xde6f): undefined reference to `floor‘pp.o: In function `Perl_pp_pow‘:pp.c:(.text+0xe1b3): undefined reference to `pow‘pp.o:(.rodata+0x260): undefined reference to `cos‘pp.o:(.rodata+0x268): undefined reference to `sin‘pp.o:(.rodata+0x270): undefined reference to `sin‘pp.o:(.rodata+0x278): undefined reference to `exp‘pp.o:(.rodata+0x280): undefined reference to `log‘pp.o:(.rodata+0x288): undefined reference to `sqrt‘pp_sys.o: In function `S_gmtime64_r‘:pp_sys.c:(.text+0x1c21): undefined reference to `ceil‘pp_sys.c:(.text+0x1c7e): undefined reference to `ceil‘pp_sys.c:(.text+0x1ce3): undefined reference to `ceil‘pp_sys.c:(.text+0x1da1): undefined reference to `floor‘pp_sys.c:(.text+0x1f11): undefined reference to `floor‘pp_sys.c:(.text+0x1f65): undefined reference to `floor‘pp_sys.c:(.text+0x1f85): undefined reference to `floor‘pp_sys.c:(.text+0x1fc0): undefined reference to `ceil‘pp_sys.c:(.text+0x2119): undefined reference to `fmod‘pp_sys.c:(.text+0x2155): undefined reference to `fmod‘pp_sys.c:(.text+0x2193): undefined reference to `fmod‘pp_sys.c:(.text+0x21cb): undefined reference to `fmod‘pp_sys.o: In function `Perl_pp_gmtime‘:pp_sys.c:(.text+0x2287): undefined reference to `floor‘pp_pack.o: In function `S_pack_rec‘:pp_pack.c:(.text+0x369b): undefined reference to `floor‘pp_pack.c:(.text+0x36c3): undefined reference to `floor‘collect2: ld returned 1 exit statusmake: *** [miniperl] Error 1

2

make[1]: Entering directory `/data_center_02/User/wucy/soft/perl-5.14.0/dist/IO‘cc -c?? -DOVR_DBL_DIG=14 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2?? -DVERSION=\"1.25_04\" -DXS_VERSION=\"1.25_04\"? "-I../.."?? IO.cIO.xs: In function ‘XS_IO__Poll__poll‘:IO.xs:249: error: invalid application of ‘sizeof‘ to incomplete type ‘struct pollfd‘IO.xs:253: error: invalid use of undefined type ‘struct pollfd‘IO.xs:253: error: dereferencing pointer to incomplete typeIO.xs:255: error: invalid use of undefined type ‘struct pollfd‘IO.xs:255: error: dereferencing pointer to incomplete typeIO.xs:257: error: invalid use of undefined type ‘struct pollfd‘IO.xs:257: error: dereferencing pointer to incomplete typeIO.xs:261: error: invalid use of undefined type ‘struct pollfd‘IO.xs:261: error: dereferencing pointer to incomplete typeIO.xs:262: error: invalid use of undefined type ‘struct pollfd‘IO.xs:262: error: dereferencing pointer to incomplete typemake[1]: *** [IO.o] Error 1make[1]: Leaving directory `/data_center_02/User/wucy/soft/perl-5.14.0/dist/IO‘Unsuccessful make(dist/IO): code=512 at make_ext.pl line 463.make: *** [lib/auto/IO/IO.a] Error 2

3

Can‘t find extension Encode/Byte in any of cpan dist ext at make_ext.pl line 251.Can‘t find extension Encode/CN in any of cpan dist ext at make_ext.pl line 251.Can‘t find extension Encode/EBCDIC in any of cpan dist ext at make_ext.pl line 251.Can‘t find extension Encode/JP in any of cpan dist ext at make_ext.pl line 251.Can‘t find extension Encode/KR in any of cpan dist ext at make_ext.pl line 251.Can‘t find extension Encode/Symbol in any of cpan dist ext at make_ext.pl line 251.Can‘t find extension Encode/TW in any of cpan dist ext at make_ext.pl line 251.Can‘t find extension Encode/Unicode in any of cpan dist ext at make_ext.pl line 251.lib/auto/POSIX/POSIX.a(POSIX.o): In function `XS_POSIX_tmpnam‘:POSIX.c:(.text+0x4614): warning: the use of `tmpnam‘ is dangerous, better use `mkstemp‘lib/auto/Time/HiRes/HiRes.a(HiRes.o): In function `XS_Time__HiRes_clock_nanosleep‘:HiRes.c:(.text+0xac3): undefined reference to `clock_nanosleep‘lib/auto/Time/HiRes/HiRes.a(HiRes.o): In function `XS_Time__HiRes_clock_getres‘:HiRes.c:(.text+0xc8e): undefined reference to `clock_getres‘lib/auto/Time/HiRes/HiRes.a(HiRes.o): In function `XS_Time__HiRes_clock_gettime‘:HiRes.c:(.text+0xdbe): undefined reference to `clock_gettime‘collect2: ld returned 1 exit statusmake: *** [perl] Error 1

perl-5.14.0在新版gcc中編譯不通過解決辦法

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.