- 论坛徽章:
- 0
|
回复 #2 DQP 的帖子
./Configure -des -Dprefix=/usr/local/perl -Duseithreads
我这样编译的,你看可以么?
另外网上有这样的回答:
假如要讓 perl 支援 threads,必須要在 perl 編譯時就加有 WITH_THREADS=yes 的參數,否則執行需用到 threads 的 perl 時,會出現這樣的錯誤:
This Perl not built to support threads
The particular copy of Perl that you're trying to use was not built using the useithreads configuration option.
Having threads support requires all of Perl and all of the XS modules in the Perl installation to be rebuilt; it is not just a question of adding the threads module (i.e., threaded and non-threaded Perls are binary incompatible.)
以我之前用的 freebsd 7.1 為例,就得先移除舊的再重新編譯:
[root@log ~] cd /usr/ports/lang/perl5.8
[root@log perl5.8] make deinstall
.......
[root@log perl5.8] make install WITH_THREADS=yes
.......
===> Extracting for perl-threaded-5.8.8_1 出現這行就對了
.......
再進到 CPAN 安裝 threads 就好了,這樣use threads就可以正常運行了。
[root@log ~] perl -MCPAN -e shell
.......
cpan> make install threads
....... |
|