Description
I'm trying to run a basic dotnet new ios app with a native library linked. The build fails at target _LinkNativeExecutable with the error
ld: 17954 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The same library works just fine with Xamarin.iOS target using stable VS for Mac.
The same library, compiled for MacCatalyst target works well with net6.0-maccatalyst, identical code as ios.
My test projects are in this repo, which also includes the static libraries.
https://github.com/trinsic-id/okapi/tree/test-ios/example
Running dotnet run in the IosApp should attempt to run the app for simulator and produce the above error.
Running the other two projects (MacCatalystApp and XamarinIosApp) succeeds - the native library is linked correctly and invoked on app start.
The libraries only support x64 architectures, as I'm running intel mac. Check with lipo -info <library>.a
Reproduction Steps
Clone this repo at the specified branch
https://github.com/trinsic-id/okapi/tree/test-ios/example
Run dotnet run from the IosApp folder
Expected behavior
App should be run and static library linked correctly
Actual behavior
Linker error
ld: 17954 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Regression?
Yes. The same library works well with Xamarin.IOS target. See project under XamarionIosApp in the linked repo.
Known Workarounds
No response
Configuration
No response
Other information
No response
Description
I'm trying to run a basic
dotnet new iosapp with a native library linked. The build fails at target_LinkNativeExecutablewith the errorThe same library works just fine with Xamarin.iOS target using stable VS for Mac.
The same library, compiled for MacCatalyst target works well with net6.0-maccatalyst, identical code as ios.
My test projects are in this repo, which also includes the static libraries.
https://github.com/trinsic-id/okapi/tree/test-ios/example
Running
dotnet runin theIosAppshould attempt to run the app for simulator and produce the above error.Running the other two projects (
MacCatalystAppandXamarinIosApp) succeeds - the native library is linked correctly and invoked on app start.The libraries only support
x64architectures, as I'm running intel mac. Check withlipo -info <library>.aReproduction Steps
Clone this repo at the specified branch
https://github.com/trinsic-id/okapi/tree/test-ios/example
Run
dotnet runfrom theIosAppfolderExpected behavior
App should be run and static library linked correctly
Actual behavior
Linker error
Regression?
Yes. The same library works well with Xamarin.IOS target. See project under
XamarionIosAppin the linked repo.Known Workarounds
No response
Configuration
No response
Other information
No response