dotnet / android-samples

A collection of .NET for Android sample projects
https://dotnet.microsoft.com/apps/mobile
MIT License
2.21k stars 4.05k forks source link

San Angeles ndk demo cannot be loaded #349

Closed gkarabin closed 5 months ago

gkarabin commented 1 year ago

Sample link

https://github.com/xamarin/monodroid-samples/tree/main/SanAngeles_NDK/SanAngeles_NativeDebug https://learn.microsoft.com/en-us/samples/xamarin/monodroid-samples/sanangeles-ndk/

Issue description

I am trying to load the old "San Angeles" native debug demo app into Visual Studio 2022 and debug it using the native C++ debugger, so that I can have a reference for getting native C++ debugging to work with my C++ library (as opposed to C#).

The app does not build or deploy by default on a Visual Studio 2022 install that is otherwise set up for Android cross-platform C++ development. I have no problems building Android native C++ code - I just can't debug it with a C++ debugger.

Steps to reproduce the issue

  1. Load the SanAngeles_NativeDebug\SanAngeles.sln solution.
  2. Try to build or deploy

What's the expected result?

App builds, deploys, and lets me set breakpoints, etc, in native C++ code.

What's the actual result?

Build started... 1>------ Build started: Project: SanAngelesLibrary, Configuration: Debug ARM ------ 1>ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk 1>ANDROID_SDK_ROOT=C:\Program Files (x86)\Android\android-sdk 1>ANT_HOME= 1>JAVA_HOME=C:\Program Files\Android\jdk\jdk-8.0.302.8-hotspot\jdk8u302-b08 1>NDK_ROOT=C:\Microsoft\AndroidNDK\android-ndk-r23c 1>app-android.c 1>demo.c 1>importgl.c 1>ld: error: cannot open crtbegin_so.o: No such file or directory 1>ld: error: cannot open crtend_so.o: No such file or directory 1>clang: error: linker command failed with exit code 1 (use -v to see invocation) 1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Application Type\Android\3.0\Android.Common.targets(125,5): error MSB6006: "clang.exe" exited with code 1. 1>Done building project "SanAngelesLibrary.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ========== Elapsed 00:00.892 ==========

alirong commented 1 year ago

这是来自QQ邮箱的自动回复邮件。   您好,我已经收到您的邮件。谢谢