0

I am creating Binding DLL for Xamarin.Mac using the Binding project in visual studio Mac.

I am able to build Binding DLL successfully, However while going to use that binding DLL in Xamarin.Mac project then it returns bellow error.

MMP : error MM5109: Native linking failed with error code 1. Check build log for details.


Error Detail :

Building: CompatibleToXamarinForms.Mac (Release|iPhone) Build started 23-10-2018 17:16:33.


Project "/Users/XYZ/Desktop/John/Agora/CompatibleToXamarinForms/CompatibleToXamarinForms.Mac/CompatibleToXamarinForms.Mac.csproj" (Build target(s)):

Target _CoreCompileImageAssets: Tool /Applications/Xcode.app/Contents/Developer/usr/bin/actool execution started with arguments: --errors --warnings --notices --output-format xml1 --output-partial-info-plist ... "___gxx_personality_v0", referenced from: -[AgoraLiveTranscoding init] in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o) -[AgoraLiveInjectStreamConfig init] in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o) -[AgoraPublisherConfiguration toJsonString] in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o) agora::rtc::RtcEngineEventHandlerIosImpl::onMediaEngineLoadSuccess() in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o) ____ZN5agora3rtc28RtcEngineEventHandlerIosImpl24onMediaEngineLoadSuccessEv_block_invoke in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o) agora::rtc::RtcEngineEventHandlerIosImpl::onMediaEngineStartCallSuccess() in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o) ____ZN5agora3rtc28RtcEngineEventHandlerIosImpl29onMediaEngineStartCallSuccessEv_block_invoke in AgoraRtcEngineKit(libagora_rtc_sdk.a-x86_64-master.o) ... ld: symbol(s) not found for architecture x86_64 clang : error : linker command failed with exit code 1 (use -v to see invocation)

MMP : error MM5109: Native linking failed with error code 1. Check build log for details. Done building target "_CompileToNative" in project "CompatibleToXamarinForms.Mac.csproj" -- FAILED.

Done building project "CompatibleToXamarinForms.Mac.csproj" -- FAILED.

Build FAILED.

/Users/XYZ/Desktop/John/Agora/CompatibleToXamarinForms/CompatibleToXamarinForms.Mac/obj/iPhone/Release/mmp-cache/registrar.m(36313,17): warning G7AC58F0F: method 'deviceBrowserView:selectionDidChange:' in protocol 'IKDeviceBrowserViewDelegate' not implemented [-Wprotocol] /Users/XYZ/Desktop/John/Agora/CompatibleToXamarinForms/CompatibleToXamarinForms.Mac/obj/iPhone/Release/mmp-cache/registrar.m(39971,2): warning GB7F1753F: method possibly missing a [super splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:] call [-Wobjc-missing-super-calls] clang : error : linker command failed with exit code 1 (use -v to see invocation) MMP : error MM5109: Native linking failed with error code 1. Check build log for details. 2 Warning(s) 2 Error(s)

Time Elapsed 00:00:22.65

---------------------- Done ----------------------

Build: 2 errors, 2 warnings

Can you please someone help to resolve this issue.

Joan Marcos
  • 105
  • 3
  • which architecture is selected for building your binding library project? – hashimks Oct 23 '18 at 12:28
  • BindingProject-->Optioins-->Compiler-->General Options-->Platform Target--> Any CPU – shawn michael Oct 23 '18 at 12:35
  • You must have used a .a file in your binding project, i was talking about the architecture you used in xcode for building that. Also see my answer – hashimks Oct 23 '18 at 12:40
  • Thanks, Please find reply for your points This is third party vendor framework, I am not using .a file, but using AgoraRtcEngineKit.framework file (mac platform) in binding project. – shawn michael Oct 23 '18 at 12:48

2 Answers2

0

Couple of things which I found from the above error

  1. You are trying to select iPhone for xamarin.mac project which is not a correct binding. Might be you have created a binding project supported for mac and you are trying to build with iPhone configuration or the other way.

  2. Did you select the same architecture while building the binding library (say the .a file) in xcode which is same as that of your xamarin iOS project?

check these both, you will get the answer.

hashimks
  • 1,205
  • 2
  • 11
  • 29
  • Thanks, Please find reply for your points Point 1: I have doubt of that but while I go in Build Project-->Options-->Build-->Compiler--Configuration section, then I didn't get any choice, Only one option which is iPhone. How to add Mac over there. Point 2: This is third party vendor framework, I am not using .a file, but using AgoraRtcEngineKit.framework file in binding project. – shawn michael Oct 23 '18 at 12:47
  • are you trying this in a windows machine? – hashimks Oct 23 '18 at 12:53
  • No, in mac machine, visual studio mac (7.4.2(build 12) – shawn michael Oct 23 '18 at 12:54
  • can u please check this link as well? https://learn.microsoft.com/en-us/xamarin/mac/get-started/hello-mac – hashimks Oct 23 '18 at 12:56
  • Thanks, I follow same steps, If I removed Binding DLL from Xamarin.Mac project then I can run the project without any error but if i add the DLL then it throw above error. My mac project is run under the Xamarin.Forms project structure. – shawn michael Oct 23 '18 at 13:01
  • its the problem mainly with the architecture used for building the .framework file. – hashimks Oct 23 '18 at 13:03
  • is there any way or command from which I can know that architecture of framework. like lipo command. – shawn michael Oct 23 '18 at 13:08
  • I am not sure on that... are you sure that this framework file is for mac os? – hashimks Oct 23 '18 at 13:08
  • Yes, vendor is confirm that framework file is for mac platform. – shawn michael Oct 23 '18 at 13:13
  • I took .framework file from "http://download.agora.io/sdk/release/Agora_Native_SDK_for_Mac_v2_2_3_FULL.zip" URL, so I don't think picked wrong place. – shawn michael Oct 23 '18 at 13:15
0

From the error log it looks like you're missing some frameworks or libraries that your native library needs to function.

If that is a Agora MacOS SDK (AgoraRtcEngineKit.framework) it would need several frameworks and libraries added as linker flags. Frameworks:

  • CoreMedia
  • CoreAudio
  • SystemConfiguration
  • QTKit
  • CoreWLAN
  • Foundation
  • AVFoundation
  • VideoToolbox
  • AudioToolbox
  • IOKit

Libraries:

  • libresolv
  • libc++

How do I know?

Usually, native libraries provide sample applications and this is where you can see which frameworks and libraries are required:

list of frameworks and libraries in for Agora Mac SDK

To be sure, please go to Visual Studio For Mac 2017 preferences and set the build log verbosity to diagnostic and post the failed build log to gist.github.com

configure Visual Studio 4 Mac to show detailed build logs

Alex Sorokoletov
  • 3,102
  • 2
  • 30
  • 52