2011-03-30 58 views
3

使用make腳本有一個lib源代碼用於Linux。 http://svn.gna.org/svn/pokersource/branches/poker-eval-java/。 我需要爲Windows構建它。它應該是兩個DLL。主dll和第二個dll是jni-wrapper來從java調用本地函數。 我已經把它在Linux下用這樣的命令:使用MinGW爲windows創建一個linux庫

autoreconf --install 
./configure --enable-java 
make 

它已成功建成並正常工作。但現在我需要爲Windows創建它。 我用GUI安裝程序安裝了MinGW,並將mingw \ bin添加到我的PATH中。 我運行相同的命令,但有錯誤的化妝:

mv -f .deps/libpoker_eval_la-deck_std.Tpo .deps/libpoker_eval_la-deck_std.Plo 
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../inclu 
de -I../include -Wall -Wpointer-arith -Wstrict-prototypes -g -O2 -MT libpoker_ 
eval_la-enumerate.lo -MD -MP -MF .deps/libpoker_eval_la-enumerate.Tpo -c -o libp 
oker_eval_la-enumerate.lo `test -f 'enumerate.c' || echo './'`enumerate.c 
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../include -I../include -Wall -Wpoi 
nter-arith -Wstrict-prototypes -g -O2 -MT libpoker_eval_la-enumerate.lo -MD -MP 
-MF .deps/libpoker_eval_la-enumerate.Tpo -c enumerate.c -DDLL_EXPORT -DPIC -o . 
libs/libpoker_eval_la-enumerate.o 
enumerate.c: In function 'enumExhaustive': 
enumerate.c:415:5: error: 'intptr_t' undeclared (first use in this function) 
enumerate.c:415:5: note: each undeclared identifier is reported only once for ea 
ch function it appears in 
make[1]: *** [libpoker_eval_la-enumerate.lo] Error 1 
make[1]: Leaving directory `/drive/eval/lib' 
make: *** [all-recursive] Error 1 

完全控制檯日誌是在這裏 http://dl.dropbox.com/u/12053587/mylog.txt

你能幫我解決這個問題? 感謝

+0

你正在使用哪個mingw-g ++版本? – smerlin 2011-03-30 11:46:19

+0

這與Java有什麼關係? – 2011-03-30 11:52:40

+0

這是一個本機庫,帶有用於java的dll-wrapper - Java Native Interface。我可以用cygwin for windows構建它。但它不起作用。導致jvm崩潰。 – NullPointer 2011-03-30 11:56:14

回答

2

您需要添加:

#include <stdint.h> 

在enumerate.c文件。這會讓你通過這個錯誤,但很可能你必須將這一行添加到多個文件中。

+0

也許可以解決問題。但是我已經在我的Ubuntu上構建了它,沒有任何更改,並且它在那裏正常工作。我也用cygwin構建了windows。它的構建也沒有錯誤。但是,當我在Windows上使用它時,JVM總是崩潰。有人說cygwin有問題,他們在cygwin上有這個lib的問題。但是他們用mingw來建造它,它起作用! – NullPointer 2011-03-30 11:52:08

+0

「C++」標準沒有規定哪些頭必須/不能被其他標準頭包含。所以最有可能在Ubuntu上,其他一些包括標準頭文件包括'stdint.h',而在Windows上它不包含。所以只需手動包含它。 – smerlin 2011-03-30 12:05:11

+0

@NullPointer當你使用的mingw環境執行時,配置腳本很可能無法正確確定它需要何時/何處'#include '。 – Petesh 2011-03-30 12:18:58