Closed softlion closed 6 years ago
Solution for those who discover this issue:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
@emaf @mauroa don't we run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
for the user as part of the XMA connection / tooling update?
This sounds like a first run problem maybe?
Hi @softlion
I got confused by your comment saying: "Build the iOS project from VS2017" which made me think you were (at least for 1 of your projects in this solution) using Xamarin.
My team pointed out to me that you're in fact probably only using the C++ iOS development tools.
If you are not using Xamarin.iOS/Forms (at part of this issue, for this solution) and only C++ for iOS, then this GitHub project (Xamarin.iOS) isn't the right place to file an issue as this has nothing to do with Xamarin.
I suggest you report a problem within Visual Studio https://docs.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio-2017?view=vs-2017 against the C++ iOS development tools.
Thanks for your feedback.
Well I am using XAMARIN !!!!
My team pointed out to me that you're in fact probably only using the C++ iOS development tools.
No they are wrong.
Note that i finally built the C++ ios library fine from VS2017, but i can not use it from a Xamarin iOS application project. The C++ project can not be added as a reference in the Xamarin iOS app project (VS refuses to add it). Is it a limitation ?
The same "C" code - Android version - compiles fine, is referenced from a Xamarin Android app project, and executes fine on a device.
Sorry this issue is very confusing, the best way to show us the problem would be to share a simple test case. If we can reproduce a Xamarin specific issue on our side we can help you with that.
Otherwise if the issue you're talking about has to do with Visual C++ (unclear) then you have to report a problem in the Visual Studio IDE.
It also sounds like we're not talking about the initial issue anymore (build error xcode-select: error: tool 'xcodebuild' requires Xcode
) but the inability to reference the C++ project in the Xamarin iOS app project (yes this could be a limitation, I can get back to you on that).
You are totally right. Should i open a new issue for it ?
Hi,
No please do not open a new issue, let me answer here.
So this is out of the scope of things we directly support (a.k.a it's possible to consume C/C++ libraries but it requires more work on your side).
We only document how to make a fat static library (.a) that supports the required iOS device architectures from Xcode because we need to provide a way for users to consume their existing Objective-C code from C#.
However you could produce a fat library and use the Objective-C binding project. You'd leave the Objective-C specific files untouched and create your managed C++ wrapper (just make sure that the file's build action is set to compile).
I would also recommend looking into tools that generate the necessary glue to surface the native API as a managed API like CppSharp: https://github.com/mono/CppSharp
Please read my colleague Alex's issue comment for inspiration (it has good links) https://github.com/xamarin/xamarin-macios/issues/5188#issuecomment-443042113 other than that you can post a question for the community on Stack Overflow [0] or the Xamarin Forums [1][2].
[0] https://stackoverflow.com/questions/tagged/xamarin [1] https://forums.xamarin.com/categories/ios [2] https://forums.xamarin.com/categories/mac
In case it might also be a helpful reference, you can find some general recommendations on the best places to ask various kinds of questions about Xamarin on:
https://developer.xamarin.com/guides/cross-platform/troubleshooting/support-options/
Cppsharp does not work correctly: it creates c++ names that are compatible with msvc but not clang/llvm or gcc. Also, even with correct mangled names, it creates code that crash. I've stopped using it and written a c interface To the c++ classes instead.
Steps to Reproduce
On VS2017 Windows
Expected Behavior
Builds fine
Actual Behavior
Fails to build
Additional infos
Environment
Build Logs