2012-03-16 33 views
1

我正在用最新的Finance :: InteractiveBrokers :: TWS 模塊在Perl中編寫一個交易程序。我開球在一個單獨的線程的命令行界面在 開始我的計劃,但後來當我試圖創建一個交易平臺的對象,我的程序 這個消息退出:在線程中使用內聯:: Java中的線程

As of Inline v0.30, use of the Inline::Config module is no longer supported or 
allowed. If Inline::Config exists on your system, it can be removed. See the 
Inline documentation for information on how to configure Inline. (You should 
find it much more straightforward than Inline::Config :-) 

我的最新版本內聯和內聯:: Java。我看着TWS.pm,它似乎沒有使用Inline :: Config。我在 '使用內聯()' 設置 'SHARED_JVM => 1' 和 'Inline->綁定()' 中TWS.pm呼籲,但沒有解決問題...

我的代碼:

use Finance::InteractiveBrokers::TWS; 
use threads; 
use threads::shared; 

our $callback; 
our $tws; 

my $interface = UserInterface->new(); 
share($interface); 
my $t = threads->create(sub{$interface->runUI()}); 

$callback= TWScallback->new(); 
$tws = Finance::InteractiveBrokers::TWS->new($manager); #This is where the program fails 

回答

1

那麼Inline::Config是否安裝在您的系統上?粗略檢查代碼並不足以說明Perl是否加載模塊。有太多深奧的方式(有些是故意的和其他的)加載一個包或者填充一個名字空間。

有問題的錯誤消息來自這行代碼在Inline.pm

croak M14_usage_Config() if %main::Inline::Config::; 

這樣東西在你的程序是填充Inline::Config命名空間。您應該執行程序指示您執行的操作:找出系統上安裝的Inline/Config.pm的位置(@INC路徑中的某處)並將其刪除。