Native Binding to C++ SDK Library failing - missing reference or native library? Soti MobiControl

RonanEgan.9044RonanEgan.9044 USMember ✭✭
edited February 2016 in Xamarin.iOS

I'm trying to bind my IOS project to SOTI Mobi Control's SDK to all us to remote view and file transfer data on and off our application.

This is the SDK, it has a working xcode example
iOS v.12 SDK - https://soti.sharefile.com/d-s3a6ba4fbd2b49cc8

iOS v.12 SDK Integration Guide - https://soti.sharefile.com/d-seb5cb97b34c41c69

I'm trying to integrate to the native library so I can do a DLL import style call to this library. Objective sharpie integration didn't make sense as the library is written in C--

After a few tweaks my MTOUCH arguments are as follows:

_
-cxx -gcc_flags '-L${ProjectDir} -lSOTIMCAgentSDK -lz -framework CoreData -framework CoreLocation -framework SystemConfiguration -framework CoreTelephony -force_load ${ProjectDir}/libSOTIMCAgentSDK.a'
_

These are the reccommended setup steps for the XCode Project:

Set Build Settings > Linking > Other Linker Flags to –all_load or force_load. This is required due to unexpected Xcode behavior that prevents -ObjC from loading object files from static libraries that contain only categories and no classes.
2. Configure Build Settings > Apple LLVM 6.1 – Language C++ > C++ Language Dialect and C++ Standard Library to Compiler Default.
3. Set General > Linked Frameworks and Libraries to include the following required frameworks, and link the SDK binary:
 libstdc++.6.dylib
 libz.dylib

 CoreLocation.framework
 CoreData.framework
 SystemConfiguration.framework
 CoreTelephony.framework
 libSOTIMCAgentSDK.a

This is the error I'm getting:

MTOUCH: error MT5210: Native linking failed, undefined symbol: std::string::_Rep::_M_destroy(std::allocator const&). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH: error MT5210: Native linking failed, undefined symbol: std::string::_Rep::_S_empty_rep_storage. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH: error MT5210: Native linking failed, undefined symbol: std::basic_string<char, std::char_traits, std::allocator >::basic_string(char const*, std::allocator const&). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH: error MT5210: Native linking failed, undefined symbol: std::runtime_error::runtime_error(std::string const&). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH: error MT5210: Native linking failed, undefined symbol: std::_Rb_tree_decrement(std::_Rb_tree_node_base*). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH: error MT5210: Native linking failed, undefined symbol: std::_Rb_tree_increment(std::_Rb_tree_node_base const*). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH: error MT5210: Native linking failed, undefined symbol: std::_Rb_tree_increment(std::_Rb_tree_node_base*). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH: error MT5210: Native linking failed, undefined symbol: std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH: error MT5210: Native linking failed, undefined symbol: std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&). Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.
MTOUCH: error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -L/Users/tomgolden/Development/AMCS.Hardware/HardwareServices/HardwareServices/iOS -lSOTIMCAgentSDK -lz -lstdc++ -framework CoreData -framework CoreLocation -framework SystemConfiguration -framework CoreTelephony -force_load /Users/tomgolden/Development/AMCS.Hardware/HardwareServices/HardwareServices/iOS/libSOTIMCAgentSDK.a
MTOUCH: error MT5202: Native linking failed. Please review the build log.
Task "MTouch" execution — FAILED

Tagged:

Posts

  • RonanEgan.9044RonanEgan.9044 USMember ✭✭
    edited March 2016

    thanks to some advice from Xamarin Support I got this building by comparing xcode linker commands on the working sample project to what xamarin studio was doing:

    This is the xcode output:

    -Xlinker @executable_path/Frameworks -miphoneos-version-min=7.0 -dead_strip -all_load -fobjc-arc -fobjc-link-runtime -lSOTIMCAgentSDK -lz -framework CoreLocation -framework CoreData -framework SystemConfiguration -framework CoreTelephony -lstdc++.6

    my original arguments as ran in Xamarin Studio:

    -dsym=no -cxx -v -v -v -v --gcc_flags "-lstdc++ -L/Users/tomgolden/Development/AMCS.Hardware/HardwareServices/HardwareServices/iOS -force_load /Users/tomgolden/Development/AMCS.Hardware/HardwareServices/HardwareServices/iOS/libSOTIMCAgentSDK.a -lSOTIMCAgentSDK -lz -framework CoreData -framework CoreLocation -framework SystemConfiguration -framework CoreTelephony

    My working xamarin studio arguments are:

    -cxx -v -v -v -v --gcc_flags '-lstdc++.6 -L${ProjectDir} -force_load ${ProjectDir}/libSOTIMCAgentSDK.a -lSOTIMCAgentSDK -lz -dead_strip -all_load -framework CoreData -framework CoreLocation -framework SystemConfiguration -framework CoreTelephony’

  • DeLoyBakerDeLoyBaker USUniversity ✭✭

    Ronan,

    Curious if you were able to successfully bind the Soti Mobicontrol SDK to your iOS project? We are about to attempt to do the same and hoping you could provide some helpful tips... :wink:

    Thanks!!!

    DeLoy

Sign In or Register to comment.