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` compiler option required #89

Closed SorraTheOrc closed 8 years ago

SorraTheOrc commented 8 years ago

To use HoloToolkit it is necessary to set the -unsafe compiler option. I'm new to C# so I'm not sure what this means, but I did find the following text on the Unity forums:

"Again, using unsafe doesn't give you much advantages, it just opens up for a huge variety of errors, mistakes and unexpected behaviour. Unless you know exactly what you do and you use pointers sparsely you shouldn't go for an unsafe context. " (http://answers.unity3d.com/questions/804103/how-to-enable-unsafe-and-use-pointers.html)

Is it wise to require unsafe? If this needs to remain then this should be documented in the readme (see link above for documentation)

SorraTheOrc commented 8 years ago

Seems the above solution doesn't make the errors go away at build time. An example of the error I'm getting is "Assets\HoloToolkit\Assets\HoloToolkit\Sharing\Scripts\SDK\TagImage.cs(51,22): error CS0227: Unsafe code may only appear if compiling with /unsafe"

I've checked the "Allow unsafe code" box in Visual Studio, but that doesn't help.

SorraTheOrc commented 8 years ago

I was doing it wrong, see the Getting Started guide submitted in #91.