首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在标记"(“之前缺少二元运算符的情况下,为iOS错误编译XBMC

在标记"(“之前缺少二元运算符的情况下,为iOS错误编译XBMC
EN

Stack Overflow用户
提问于 2013-05-10 15:49:39
回答 1查看 686关注 0票数 1

我正在使用以下配置为iOS编译XBMC:

$ cd $HOME/XBMC $ cd tools/depends $ ./bootstrap $ ./configure --host=arm-apple-darwin $ make

我得到以下输出:

代码语言:javascript
复制
>/bin/sh ../../libtool  --tag=CC   --mode=compile /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -DHAVE_CONFIG_H -I. -I../..  -I../../include/shairplay  -std=gnu99 -no_compact_linkedit -no-cpp-precomp -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -pipe -Wno-trigraphs -fpascal-strings -O3 -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2 -arch armv7 -miphoneos-version-min=4.2  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -I/Users/Shared/xbmc-depends/iphoneos6.1_armv7-target/include   -std=gnu99 -no_compact_linkedit -no-cpp-precomp -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -pipe -Wno-trigraphs -fpascal-strings -O3 -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2 -arch armv7 -miphoneos-version-min=4.2  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -I/Users/Shared/xbmc-depends/iphoneos6.1_armv7-target/include  -MT libshairplay_la-dnssd.lo -MD -MP -MF .deps/libshairplay_la-dnssd.Tpo -c -o libshairplay_la-dnssd.lo `test -f 'dnssd.c' || echo './'`dnssd.c
libtool: compile:  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -DHAVE_CONFIG_H -I. -I../.. -I../../include/shairplay -std=gnu99 -no_compact_linkedit -no-cpp-precomp -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -pipe -Wno-trigraphs -fpascal-strings -O3 -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2 -arch armv7 -miphoneos-version-min=4.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -I/Users/Shared/xbmc-depends/iphoneos6.1_armv7-target/include -std=gnu99 -no_compact_linkedit -no-cpp-precomp -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -pipe -Wno-trigraphs -fpascal-strings -O3 -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2 -arch armv7 -miphoneos-version-min=4.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -I/Users/Shared/xbmc-depends/iphoneos6.1_armv7-target/include -MT libshairplay_la-dnssd.lo -MD -MP -MF .deps/libshairplay_la-dnssd.Tpo -c dnssd.c  -fno-common -DPIC -o .libs/libshairplay_la-dnssd.o
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/dispatch/dispatch.h:49,
                 from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/dns_sd.h:140,
                 from dnssd.c:62:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/include/dispatch/base.h:103:44: error: missing binary operator before token "("
make[7]: *** [libshairplay_la-dnssd.lo] Error 1
make[6]: *** [all-recursive] Error 1
make[5]: *** [all-recursive] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all] Error 2
make[2]: *** [iphoneos6.1_armv7-target/src/lib/.libs/libshairplay.so.0.0.0] Error 2
make[1]: *** [libshairplay] Error 2
make: *** [target/.installed-iphoneos6.1_armv7-target] Error 2

我在下面的代码中找到dispatch.h 49行:

代码语言:javascript
复制
#include <dispatch/base.h>

下面的dns_sd.h 140代码行:

代码语言:javascript
复制
 #if _DNS_SD_LIBDISPATCH
 #include <dispatch/dispatch.h>
 #endif

base.h 103行:

代码语言:javascript
复制
 #if defined(__has_feature) && __has_feature(objc_fixed_enum)
 #define DISPATCH_ENUM(name, type, ...) \       typedef enum : type { __VA_ARGS__ } name##_t
 #else
 #define DISPATCH_ENUM(name, type, ...) \       enum { __VA_ARGS__ }; typedef type name##_t
 #endif

base.h 44行:

代码语言:javascript
复制
 #define DISPATCH_SENTINEL __attribute__((__sentinel__))

dnssd.c 62行:

代码语言:javascript
复制
 #include <dns_sd.h>
 #define DNSSD_STDCALL

我不明白为什么它在这里抱怨一个二元运算符,这是一个XBMC错误吗?

EN

回答 1

Stack Overflow用户

发布于 2013-05-21 16:35:28

我刚接触clang,但是我设法解决了这个问题。打开文件:

代码语言:javascript
复制
dnssd.c

并将以下代码粘贴到文件的顶部:

代码语言:javascript
复制
#ifndef __has_feature         // Optional of course.
  #define __has_feature(x) 0  // Compatibility with non-clang compilers.
#endif
#ifndef __has_extension
  #define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
#endif

Clang Language documentation开始,它将提高与某些编译器的兼容性。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16477479

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档