2013-05-21 55 views
0

我試圖從libev-3.8(編譯OSX 10.8上的很好)升級到libev-4.15並獲得以下錯誤。libev-4.15不能在OSX上編譯10.8

third_party/libev-4.15/ev.h:234: error: expected identifier before numeric constant 
third_party/libev-4.15/ev.h:234: error: expected `}' before numeric constant 
third_party/libev-4.15/ev.h:234: error: expected unqualified-id before numeric constant 
third_party/libev-4.15/ev.h:842: error: expected declaration before ‘}’ token 

鏈接ev.h:http://cvs.schmorp.de/libev/ev.h?revision=1.171&view=markup

我的系統配置:

checking host system type... i386-apple-darwin12.3.0 
checking target system type... i386-apple-darwin12.3.0 
checking for ld used by gcc... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld 
checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no 
checking how to convert i386-apple-darwin12.3.0 file names to i386-apple-darwin12.3.0 format... func_convert_file_noop 
checking how to convert i386-apple-darwin12.3.0 file names to toolchain format... func_convert_file_noop 
checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r 

FWIW,相同的配置編譯罰款CentOS5.6。

回答

1

原來的問題是,OSX上的「EV_ERROR」在「ev.h」中聲明與「/usr/include/sys/event.h」中聲明的相沖突。

作爲一個修復,我不得不轉發聲明我使用的ev變量,而不是直接在我的源文件之一中包含ev.h。那就是訣竅。