简体   繁体   English

libusb 1.0.20不会在osx优胜美地上编译

[英]libusb 1.0.20 wont compile on osx yosemite

I'm trying to install the new libusb 1.0.20 version on my mac for a project i;m working on. 我正在尝试在Mac上为正在进行的项目安装新的libusb 1.0.20版本。 Mainly i'm interested in the libusb static libraries .a and .la 我主要对libusb静态库.a和.la感兴趣

I got the source code from online and I go into the directory and type ./configure adn the package configures properly. 我从在线获取源代码,然后进入目录并键入./configure和软件包已正确配置。 now after I enter make, it goes all crazy with errors. 现在进入make后,它会因错误而疯狂。 I cant seem to figure it out. 我似乎无法弄清楚。 I think it might be something to do with the settings of my machine but I cant seem to figure it out. 我认为这可能与机器的设置有关,但我似乎无法弄清楚。 Can someone please help me. 有人可以帮帮我吗。 This is what I'm getting: 这就是我得到的:

 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

Solvedf it. 解决了。 apparently switching CC from gcc to clang solves the problem. 显然,将CC从gcc切换到clang可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM