[英]libusb 1.0.20 wont compile on osx yosemite
我正在嘗試在Mac上為正在進行的項目安裝新的libusb 1.0.20版本。 我主要對libusb靜態庫.a和.la感興趣
我從在線獲取源代碼,然后進入目錄並鍵入./configure和軟件包已正確配置。 現在進入make后,它會因錯誤而瘋狂。 我似乎無法弄清楚。 我認為這可能與機器的設置有關,但我似乎無法弄清楚。 有人可以幫幫我嗎。 這就是我得到的:
make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in libusb
CC libusb_1_0_la-core.lo
CC libusb_1_0_la-descriptor.lo
CC libusb_1_0_la-io.lo
CC libusb_1_0_la-strerror.lo
CC libusb_1_0_la-sync.lo
CC libusb_1_0_la-hotplug.lo
CC os/libusb_1_0_la-threads_posix.lo
CC os/libusb_1_0_la-darwin_usb.lo
In file included from /usr/include/dispatch/dispatch.h:51:0,
from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15,
from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13,
from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:55,
from /System/Library/Frameworks/IOKit.framework/Headers/IOCFBundle.h:26,
from os/darwin_usb.h:26,
from os/darwin_usb.c:43:
/usr/include/dispatch/object.h:143:15: error: expected identifier or '(' before '^' token
typedef void (^dispatch_block_t)(void);
^
/usr/include/dispatch/object.h:362:3: error: unknown type name 'dispatch_block_t'
dispatch_block_t notification_block);
^
In file included from /System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBLib.h:27:0,
from os/darwin_usb.h:27,
from os/darwin_usb.c:43:
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:601:9: error: too many #pragma options align=reset
#pragma options align=reset
^
In file included from /System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBLib.h:27:0,
from os/darwin_usb.h:27,
from os/darwin_usb.c:43:
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:771:9: error: too many #pragma options align=reset
#pragma options align=reset
^
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:823:9: error: too many #pragma options align=reset
#pragma options align=reset
^
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:841:9: error: too many #pragma options align=reset
#pragma options align=reset
^
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:861:9: error: too many #pragma options align=reset
#pragma options align=reset
^
os/darwin_usb.c: In function 'darwin_get_device_descriptor':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:484:39: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);
^
os/darwin_usb.c: In function 'get_configuration_index':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:495:39: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);
^
os/darwin_usb.c: In function 'darwin_get_active_config_descriptor':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:517:39: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);
^
os/darwin_usb.c: In function 'darwin_get_config_descriptor':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:531:39: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *priv = DARWIN_CACHED_DEVICE(dev);
^
os/darwin_usb.c: In function 'darwin_open':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:946:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
^
os/darwin_usb.c: In function 'darwin_close':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:995:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
^
os/darwin_usb.c: In function 'darwin_get_configuration':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:1034:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
^
os/darwin_usb.c: In function 'darwin_set_configuration':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:1042:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
^
os/darwin_usb.c: In function 'darwin_claim_interface':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:1147:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
^
os/darwin_usb.c: In function 'darwin_reset_device':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:1331:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
^
os/darwin_usb.c: In function 'darwin_kernel_driver_active':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:1383:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(dev_handle->dev);
^
os/darwin_usb.c: In function 'submit_control_transfer':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:1615:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev);
^
os/darwin_usb.c: In function 'cancel_control_transfer':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:1685:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev);
^
os/darwin_usb.c: In function 'darwin_abort_transfers':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
#define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *) (((struct darwin_device_priv *)((a)->os_priv))->dev))
^
os/darwin_usb.c:1700:40: note: in expansion of macro 'DARWIN_CACHED_DEVICE'
struct darwin_cached_device *dpriv = DARWIN_CACHED_DEVICE(transfer->dev_handle->dev);
^
make[3]: *** [os/libusb_1_0_la-darwin_usb.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
解決了。 顯然,將CC從gcc切換到clang可以解決此問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.