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