admin管理员组文章数量:1122846
I am using swift interoperability to use C++ code in my swift package. And the code is working fine on XCode 15, but after upgrading my Xcode to 16 I'm facing some issues.
The enum class in C++:
#ifndef ResolutionType_hpp
#define ResolutionType_hpp
#include <stdio.h>
enum class ResolutionType
{
ORIGINAL = 9991,
CUSTOM = 9992,
_24P = 9993,
_36P = 9994,
_48P = 9995,
_72P = 9996,
_90P = 9997,
_120P = 9998,
_144P = 9999,
_240P = 10000,
_320P = 10001,
_360P = 10002,
_480P = 10003,
_576P = 10004,
_640P = 10005,
_720P = 10006,
_1080P = 10007,
_1440P = 10008,
_2160P = 10009,
_4320P = 10010,
};
#endif /* ResolutionType_hpp */
My C++ code:
std::vector<ResolutionType> VideoCutterManager::getSupportedResolutionList(int index){
std::vector<ResolutionType> list;
return list;
}
And my Swift call:
public func getSupportedResolutionList(index : Int) -> [ResolutionType] {
let supportedList = manager.getSupportedResolutionList(Int32(index))
return supportedList.map { ResolutionType(rawValue: $0.rawValue)! }
}
Whenever I call this function from my swift code I get an error :
Multiple definitions of symbol '$sSo1soiySiSo3stdO3__1O0036___wrap_iterUnsafePointer__DgGIinaBdaV_AGtFTO'
Function type mismatch, declared as '@convention(thin) (__ObjC.std.__1.__wrap_iter<UnsafePointer<_>>, __ObjC.std.__1.__wrap_iter<UnsafePointer<_>>) -> Swift.Int' but used as '@convention(thin) (__ObjC.std.__1.__wrap_iter<UnsafePointer<_>>, __ObjC.std.__1.__wrap_iter<UnsafePointer<_>>) -> Swift.Int'
I am unable to find the issue.
本文标签: iosMultiple definitions of symbolSwift CStack Overflow
版权声明:本文标题:ios - Multiple definitions of symbol - Swift C++ - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282195a1926566.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论