Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c Rust bindgen clang错误,此内置函数的常量不兼容_Objective C_Rust_Clang_Superpowered_Rust Bindgen - Fatal编程技术网

Objective c Rust bindgen clang错误,此内置函数的常量不兼容

Objective c Rust bindgen clang错误,此内置函数的常量不兼容,objective-c,rust,clang,superpowered,rust-bindgen,Objective C,Rust,Clang,Superpowered,Rust Bindgen,尝试为Obj-C++头生成绑定,该头是使用rust bindgen的超级强大跨平台音频库的一部分 我在卡特琳娜10.15.6 clang version 10.0.1 Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /usr/local/opt/llvm/bin 我被这个错误缠住了。搜索了很多,但似乎很少 我曾尝试使用Xcode应用程序包中提供的叮当声进行尝试,但无法做到这一点 这个库在Xcode中构建得很

尝试为Obj-C++头生成绑定,该头是使用rust bindgen的超级强大跨平台音频库的一部分

我在卡特琳娜10.15.6

clang version 10.0.1
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
我被这个错误缠住了。搜索了很多,但似乎很少

我曾尝试使用Xcode应用程序包中提供的叮当声进行尝试,但无法做到这一点

这个库在Xcode中构建得很好,我在那里没有遇到同样的错误

标题:

#import <AVFoundation/AVFoundation.h>

/// @brief Output channel mapping for iOS audio I/O.
/// This structure maps the channels you provide in the audio processing callback to the appropriate output channels.
/// You can have multi-channel (more than a single stereo channel) output if a HDMI or USB audio device is connected. iOS does not provide multi-channel output for other audio devices, such as wireless audio accessories.
/// @em Example:
/// Let's say you have four output channels, and you'd like the first stereo pair on USB 3+4, and the other stereo pair on the iPad's headphone socket.
/// 1. Set deviceChannels[0] to 2, deviceChannels[1] to 3.
/// 2. Set USBChannels[2] to 0, USBChannels[3] to 1.
/// @em Explanation:
/// - Your four output channels are having the identifiers: 0, 1, 2, 3.
/// - Every iOS device has just one stereo built-in output. This is represented by deviceChannels, and (1.) sets your second stereo pair (2, 3) to these.
/// - You other stereo pair (0, 1) is mapped to USBChannels. USBChannels[2] represents the third USB channel.
/// @since Multi-channel output is available in iOS 6.0 and later.
typedef struct multiOutputChannelMap {
    int deviceChannels[2]; ///< The iOS device's built-in output channels. Write only.
    int HDMIChannels[8];   ///< HDMI output channels. Write only.
    int USBChannels[32];   ///< USB output channels. Write only.
    int numberOfHDMIChannelsAvailable; ///< Number of available HDMI output channels. Read only.
    int numberOfUSBChannelsAvailable;  ///< Number of available USB output channels. Read only.
    bool headphoneAvailable;           ///< Something is plugged into the iOS device's headphone socket or not. Read only.
} multiOutputChannelMap;

/// @brief Input channel mapping for iOS audio I/O.
/// Similar to the output channels, you can map the input channels to channels in the audio processing callback. This feature works with USB only.
/// Let's say you set the channel count to 4, so RemoteIO provides 4 input channel buffers. Using this struct, you can map which USB input channel appears on the specific buffer positions.
/// @since Available in iOS 6.0 and later.
/// @see @c multiOutputChannelMap
typedef struct multiInputChannelMap {
    int USBChannels[32];              ///< Example: set USBChannels[0] to 3, to receive the input of the third USB channel on the first buffer. Write only.
    int numberOfUSBChannelsAvailable; ///< Number of USB input channels. Read only.
} multiInputChannelMap;

@protocol SuperpoweredIOSAudioIODelegate;

/// @brief The audio processing callback prototype.
/// @return Return false for no audio output (silence).
/// @param clientData A custom pointer your callback receives.
/// @param inputBuffers Input buffers.
/// @param inputChannels The number of input channels.
/// @param outputBuffers Output buffers.
/// @param outputChannels The number of output channels.
/// @param numberOfFrames The number of frames requested.
/// @param samplerate The current sample rate in Hz.
/// @param hostTime A mach timestamp, indicates when this buffer of audio will be passed to the audio output.
typedef bool (*audioProcessingCallback) (void *clientData, float **inputBuffers, unsigned int inputChannels, float **outputBuffers, unsigned int outputChannels, unsigned int numberOfFrames, unsigned int samplerate, unsigned long long hostTime);


/// @brief Handles all audio session, audio lifecycle (interruptions), output, buffer size, samplerate and routing headaches.
/// @warning All methods and setters should be called on the main thread only!
@interface SuperpoweredIOSAudioIO: NSObject {
    int preferredBufferSizeMs;
    int preferredSamplerate;
    bool saveBatteryInBackground;
    bool started;
}

@property (nonatomic, assign) int preferredBufferSizeMs;    ///< The preferred buffer size in milliseconds. Recommended: 12.
@property (nonatomic, assign) int preferredSamplerate;      ///< The preferred sample rate in Hz.
@property (nonatomic, assign) bool saveBatteryInBackground; ///< Save battery if output is silence and the app runs in background mode. True by default.
@property (nonatomic, assign, readonly) bool started;       ///< Indicates if the instance has been started.

/// @brief Constructor.
/// @param delegate The object fully implementing the SuperpoweredIOSAudioIODelegate protocol. Not retained.
/// @param preferredBufferSize The initial value for preferredBufferSizeMs. 12 is good for every iOS device (512 frames).
/// @param preferredSamplerate The preferred sample rate. 44100 or 48000 are recommended for good sound quality.
/// @param audioSessionCategory The audio session category. Audio input is enabled for the appropriate categories only!
/// @param channels The number of output channels in the audio processing callback regardless the actual hardware capabilities. The number of input channels in the audio processing callback will reflect the actual hardware configuration.
/// @param callback The audio processing callback.
/// @param clientdata Custom data passed to the audio processing callback.
- (id)initWithDelegate:(id<SuperpoweredIOSAudioIODelegate>)delegate preferredBufferSize:(unsigned int)preferredBufferSize preferredSamplerate:(unsigned int)preferredSamplerate audioSessionCategory:(NSString *)audioSessionCategory channels:(int)channels audioProcessingCallback:(audioProcessingCallback)callback clientdata:(void *)clientdata;

/// @brief Starts audio I/O.
/// @return True if successful, false if failed.
- (bool)start;

/// @brief Stops audio I/O.
- (void)stop;

/// @brief Call this to re-configure the channel mapping.
- (void)mapChannels;

/// @brief Call this to re-configure the audio session category (such as enabling/disabling recording).
- (void)reconfigureWithAudioSessionCategory:(NSString *)audioSessionCategory;

@end


/// @brief You MUST implement this protocol to use SuperpoweredIOSAudioIO.
@protocol SuperpoweredIOSAudioIODelegate

/// @brief The audio session may be interrupted by a phone call, etc. This method is called on the main thread when the interrupt starts.
@optional
- (void)interruptionStarted;

/// @brief The audio session may be interrupted by a phone call, etc. This method is called on the main thread when audio resumes.
@optional
- (void)interruptionEnded;

/// @brief Called if the user did not grant a recording permission for the app.
@optional
- (void)recordPermissionRefused;

/// @brief This method is called on the main thread when a multi-channel audio device is connected or disconnected.
/// @param outputMap Map the output channels here.
/// @param inputMap Map the input channels here.
/// @param externalAudioDeviceName The name of the attached audio device, such as the model of the sound card.
/// @param outputsAndInputs A human readable description about the available outputs and inputs.
@optional
- (void)mapChannels:(multiOutputChannelMap *)outputMap inputMap:(multiInputChannelMap *)inputMap externalAudioDeviceName:(NSString *)externalAudioDeviceName outputsAndInputs:(NSString *)outputsAndInputs;

@end
叮当声错误:

  --- stderr
  clang version 5.0.2 (tags/RELEASE_502/final)
  Target: arm64-apple-ios
  Thread model: posix
  InstalledDir:
  ignoring nonexistent directory "/usr/include"
  ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include/c++/v1"
  ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/local/include"
  ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/Library/Frameworks"
  ignoring duplicate directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include"
  #include "..." search starts here:
  #include <...> search starts here:
   /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include
   /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include
   /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks
   /usr/local/opt/llvm@5/include/c++/v1
   /usr/local/opt/llvm@5/lib/clang/5.0.2/include
   /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks (framework directory)
  End of search list.
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32395:25: error: incompatible constant for this __builtin_neon function
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32416:25: error: incompatible constant for this __builtin_neon function
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:33990:23: error: use of undeclared identifier '__builtin_neon_vrndns_f32'
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32395:25: error: incompatible constant for this __builtin_neon function, err: true
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32416:25: error: incompatible constant for this __builtin_neon function, err: true
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:33990:23: error: use of undeclared identifier '__builtin_neon_vrndns_f32', err: true
--stderr
clang版本5.0.2(标签/发布号502/最终版)
目标:arm64苹果ios
线程模型:posix
InstalledDir:
忽略不存在的目录“/usr/include”
忽略不存在的目录“/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include/c++/v1”
忽略不存在的目录“/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/local/include”
忽略不存在的目录“/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/Library/Frameworks”
忽略重复目录“/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include”
#包括“…”搜索从这里开始:
#包括搜索从这里开始:
/usr/local/ceral/llvm/10.0.1_1/lib/clang/10.0.1/include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks
/usr/本地/opt/llvm@5/包括/c++/v1
/usr/本地/opt/llvm@5/lib/clang/5.0.2/include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks(框架目录)
搜索列表结束。
/usr/local/cillar/llvm/10.0.1\u 1/lib/clang/10.0.1/include/arm\u neon.h:32395:25:错误:此内置函数的常量不兼容
/usr/local/cillar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32416:25:错误:此内置函数的常量不兼容
/usr/local/cillar/llvm/10.0.1\u 1/lib/clang/10.0.1/include/arm\u neon.h:33990:23:错误:使用未声明的标识符“\u内置\u neon\u vrndns\u f32”
/usr/local/cillar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32395:25:错误:此内置函数的常量不兼容,错误:true
/usr/local/cillar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32416:25:错误:此内置函数的常量不兼容,错误:true
/usr/local/ceral/llvm/10.0.1\u 1/lib/clang/10.0.1/include/arm\u neon.h:33990:23:错误:使用未声明的标识符“\uu内置\u neon\u vrndns\u f32”,错误:true
被困在这里了,有什么想法吗

我们发现:

def err\u无效\u neon\u类型\u代码:错误<
“此内置函数的不兼容常量”>
最新消息:):

--target=armv7苹果ios
构建良好。
--target=arm64苹果ios
出现错误


我已更新到Xcode 12.0,将尝试并报告。

尝试
--target=aarch64苹果ios
。至少
rustup目标列表
没有
arm64苹果ios
,它有
aarch64苹果ios

顺便说一句,我已经改变了策略,不再需要绑定Objective-C++了。不幸的是,
aarch64苹果ios
在三重命名中对应于
arm64苹果ios
  --- stderr
  clang version 5.0.2 (tags/RELEASE_502/final)
  Target: arm64-apple-ios
  Thread model: posix
  InstalledDir:
  ignoring nonexistent directory "/usr/include"
  ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include/c++/v1"
  ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/local/include"
  ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/Library/Frameworks"
  ignoring duplicate directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include"
  #include "..." search starts here:
  #include <...> search starts here:
   /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include
   /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/usr/include
   /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks
   /usr/local/opt/llvm@5/include/c++/v1
   /usr/local/opt/llvm@5/lib/clang/5.0.2/include
   /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.6.sdk/System/Library/Frameworks (framework directory)
  End of search list.
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32395:25: error: incompatible constant for this __builtin_neon function
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32416:25: error: incompatible constant for this __builtin_neon function
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:33990:23: error: use of undeclared identifier '__builtin_neon_vrndns_f32'
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32395:25: error: incompatible constant for this __builtin_neon function, err: true
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:32416:25: error: incompatible constant for this __builtin_neon function, err: true
  /usr/local/Cellar/llvm/10.0.1_1/lib/clang/10.0.1/include/arm_neon.h:33990:23: error: use of undeclared identifier '__builtin_neon_vrndns_f32', err: true
def err_invalid_neon_type_code : Error<
  "incompatible constant for this __builtin_neon function">