Search Unity

(Case 1139579) Using Mathf.Infinity makes IL2CPP compile error

Discussion in '2019.1 Beta' started by Kichang-Kim, Mar 22, 2019.

  1. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    331
    Hi, I found that using Mathf.Infinity makes IL2CPP compile error with Unity 2019.1.0b8, Android ARM64 platform.

    If you used Mathf.Infinity in your code, IL2CPP compiling is failed with error like this:
     
  2. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    4,118
    Could you please submit a bug-report as described in this document:
    https://unity3d.com/unity/qa/bug-reporting

    It's important that you report these issues together with a reproduction project if you want them to get fixed. If you don't do it, it might be a long time until someone else reports them or until Unity Technologies find them.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. You can post this Case number here (in this forum thread) for Unity staff to pick up, in case they see it.
     
    LeonhardP and DavidGeoffroy like this.
  3. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    331
    I sent bug report, Case 1139579.
     
  4. futurlab_peterh

    futurlab_peterh

    Joined:
    Jan 23, 2018
    Posts:
    22
    Hi, this error is also happening on our project (running 2019.1.0b9) on PS4 and Xbox One builds (strangely enough, Switch builds seem to come out fine).

    Is there a known workaround for it, until an actual fix is in place?
     
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    4,038
    There is a work around for this issue. In the Unity editor installation, you can modify the Data/il2cpp/libil2cpp/codegen/il2cpp-codegen-il2cpp.h file and add this line near the top:

    #include <limits>

    This is just a work around for beta releases though. Before the 2019.1 release ships we will correct this issue.
     
  6. futurlab_peterh

    futurlab_peterh

    Joined:
    Jan 23, 2018
    Posts:
    22

    This worked perfectly, thank you!
     
  7. rtorresbonetff

    rtorresbonetff

    Joined:
    Jan 3, 2019
    Posts:
    4
    I had the same issue, thank you!
    How did you find out it was because of Mathf.Infinity?
     
  8. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    331
    I checked Unity's console log and investigated auto-generated il2cpp c++ source files (Temp/il2cppOutput). In that file, there are useful information about source C# types. (like type names)