xamarin / mac-samples

Sample programs showing how to use Xamarin.Mac on OSX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build failed: Undefined symbol error

m-mcgeehan opened this issue · comments

My build fails and I receive the following error when compiling. This occurs during the Link HeartRateMonitor (x86_64) step. Can anybody help me resolve this issue? Thanks. I'm using VS 8.9.8 and Xcode 12.5.

Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please add your complete version information:

Visual Studio: Help > About Microsoft Visual Studio > Copy Info [button]
Visual Studio for Mac: Visual Studio > About Visual Studio > Show Details > Copy Information [button]

Also please attach a diagnostic build log:

Logs can be found in the Build Output tab of the Errors pad in Visual Studio
To get full build logs, set the log verbosity to diagnostic at the following locations:
- On Visual Studio for Mac: Preferences > Projects > Build
- On Visual Studio for Windows: Tools > Options > Projects and Solutions > Build and Run

Appolgies for not providing enough info in my first post. Here is your requested info.

VS build: === Visual Studio Community 2019 for Mac ===

Version 8.9.8 (build 7)
Installation UUID: 25f8cb1d-3c09-4f85-a3ea-122db6206293
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000125

=== Mono Framework MDK ===

Runtime:
Mono 6.12.0.125 (2020-02/8c552e98bd6) (64-bit)
Package version: 612000125

=== Roslyn (Language Service) ===

3.9.0-6.21152.10+c10f884b30737542ddd84ca889a4aad9281ce210

=== NuGet ===

Version: 5.8.0.6860

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/5.0.202/Sdks
SDK Versions:
5.0.202
3.1.408
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
5.0.5
3.1.14

=== .NET Core 3.1 SDK ===

SDK: 3.1.408

=== Xamarin.Profiler ===

Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 12.5 (18205)
Build 12E262

=== Xamarin.Mac ===

Version: 7.10.0.5 (Visual Studio Community)
Hash: ab40b131d
Branch: xcode12.5
Build date: 2021-04-22 08:56:41-0400

=== Xamarin.iOS ===

Xamarin.iOS not installed.
Can't find mtouch or the Version file at /Library/Frameworks/Xamarin.iOS.framework/Versions/Current.

=== Xamarin Designer ===

Version: 16.9.0.324
Hash: b1e216c75
Branch: remotes/origin/d16-9
Build date: 2021-04-16 00:02:50 UTC

=== Xamarin.Android ===

Not Installed

=== Microsoft OpenJDK for Mobile ===

Java SDK: Not Found

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.9.0.22
Hash: a391de2
Branch: remotes/origin/dev/bretjohn/readme-tweak~3
Build date: 2021-04-21 21:23:40 UTC

=== Android Device Manager ===

Version: 16.9.0.17
Hash: fc2b3db
Branch: remotes/origin/dev/jmt/d16-9bump~1
Build date: 2021-04-21 21:23:58 UTC

=== Build Information ===

Release ID: 809080007
Git revision: 85b793ce322599fe423c2d233c346b13824ca4d8
Build date: 2021-04-28 12:54:34-04
Build branch: release-8.9
Xamarin extensions: 85b793ce322599fe423c2d233c346b13824ca4d8

=== Operating System ===

Mac OS X 10.16.0
Darwin 20.3.0 Darwin Kernel Version 20.3.0
Thu Jan 21 00:07:06 PST 2021
root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

Error Log from VS (please note that the error I mentioned in my first post occurs in Xcode):
/Users/[user]/Projects/Xamarin_Mac___HeartRateMonitor/MainWindow.xib: Warning: Automatic preferred width mode for static wrapping text before OS X 10.11, use Explicit or First Runtime Layout Width (HeartRateMonitor) ibtool

I have tested the project with the following environment and everything works as expected:

=== Visual Studio Enterprise 2019 for Mac ===

Version 8.10 (build 1773)
Installation UUID: 8d12e55e-3489-463f-ac52-8cb4573c5a81
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000145

=== Mono Framework MDK ===

Runtime:
Mono 6.12.0.145 (2020-02/c633fe92383) (64-bit)
Package version: 612000145

=== Roslyn (Language Service) ===

3.10.0-3.21251.8+4c32f5e4e9c0828a94fd4d1c9c0994082c85aaf3

=== NuGet ===

Version: 5.9.0.7134

=== .NET Core SDK ===

SDK: Not installed
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: Not installed

=== .NET Core 3.1 SDK ===

SDK: Not installed

=== Xamarin.Profiler ===

Version: 1.6.13.11
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Xamarin.Android ===

Version: 11.3.0.1 (Visual Studio Enterprise)
Commit: xamarin-android/d16-10/22fc2b3
Android SDK: /Users/mandel/Library/Android/sdk
Supported Android versions:
6.0 (API level 23)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 31.0.2
SDK Build Tools Version: 31.0.0 rc3

Build Information:
Mono: b4a3858
Java.Interop: xamarin/java.interop/d16-10@f39db25
ProGuard: Guardsquare/proguard@912d149
SQLite: xamarin/sqlite@85460d3
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-10@c5732a0

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/mandel/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.10.0.12
Hash: e240b8c
Branch: remotes/origin/d16-10
Build date: 2021-05-13 17:01:38 UTC

=== Android Device Manager ===

Version: 16.10.0.14
Hash: e340248
Branch: remotes/origin/d16-10
Build date: 2021-05-13 17:01:56 UTC

=== Apple Developer Tools ===

Xcode 13.0 (19203.1)
Build 13A5192i

=== Xamarin.Mac ===

Version: 7.99.0.190 (Visual Studio Enterprise)
Hash: 930705223
Branch: main
Build date: 2021-08-09 11:26:53-0400

=== Xamarin.iOS ===

Version: 14.99.0.332 (Visual Studio Enterprise)
Hash: 930705223
Branch: main
Build date: 2021-08-09 11:26:53-0400

=== Xamarin Designer ===

Version: 16.10.0.117
Hash: 249267d55
Branch: remotes/origin/d16-10
Build date: 2021-05-24 21:27:04 UTC

=== Build Information ===

Release ID: 810001773
Git revision: 56d63e5691f86f863cfaed823a5a8fe430e1aaa9
Build date: 2021-05-28 11:21:28-04
Build branch: release-8.10

=== Operating System ===

Mac OS X 10.16.0
Darwin 20.5.0 Darwin Kernel Version 20.5.0
Sat May 8 05:10:33 PDT 2021
root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

VsVim 2.8.0.11

Can you please try to update to 8.10 to see if that solves the issue?

We have not received any further information and believe this issue to be fixed.
If this is not the case then please provide the requested information so this can be investigated again.