这是我主要的swift文件内容:
import Foundation
let argc = CommandLine.argc
let argv = UnsafeMutableRawPointer(CommandLine.unsafeArgv)
.bindMemory(
to: UnsafeMutablePointer<Int8>.self,
capacity: Int(CommandLine.argc)
)
trialFunc(argc, argv) <-- error in this line
我的.h文件包含
void trialFunc(int argc, char *argv);
我的.c文件包含
void trialFunc(int argc, char *argv)
{
// Some code
}
Bridging标头包含我的.h文件的include语句。
我从swift调用trialFunc的错误是
无法将类型
UnsafeMutablePointer<UnsafeMutablePointer<int8>>
的值转换为预期的参数类型UnsafeMutablePointer<int8>!