microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

"Unsafe code requires the `unsafe' command line option to be specified" #124

Closed robertlevy closed 8 years ago

robertlevy commented 8 years ago

Getting a bunch of errors with the message in the title when importing this package into a new project.

My steps (which I think matches what the docs suggest):

  1. I just grabbed the lated Unity HTP (beta 24) and the latest from this repo.
  2. Opened the contents of this repo in Unity and did Assets->Export Package
  3. Created a brand new project in Unity and did Assets->Import Package->Custom and chose the thing I just exported

The import completes but the HoloToolkit menu does not appear. Instead, I see 7 messages in the error list like: "Assets/HoloToolkit/Sharing/Scripts/SDK/AnchorDownloadRequest.cs(58,22): error CS0227: Unsafe code requires the `unsafe' command line option to be specified". All 7 messages have the same error, just different files.

jwittner commented 8 years ago

Did you have the Assets/HoloToolkit folder selected when you went to export the package? If so, that'll miss the required compiler options files that are in the Assets folder. If you select Assets and do a package export that should catch them.

If that doesn't work for you, please let me know.

robertlevy commented 8 years ago

cool that did the trick. please consider if this warrants a clarification in the gettingstarted.md

jwittner commented 8 years ago

This wasn't the first time, so I think we'll use this chance to update the docs. Thanks!

riverar commented 8 years ago

I also noticed this behavior when using Unity re-import functionality to resolve my project's state after a Untiy crash.