Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Building Library\Bee\artifacts\WinPlayerBuildProgram\ManagedStripped failed

Discussion in 'Windows' started by Reimirno7, May 8, 2023.

  1. Reimirno7

    Reimirno7

    Joined:
    Nov 25, 2021
    Posts:
    51
    Build failure when building with IL2CPP to Windows. Mono works fine. Please help!

    Using Unity 2021.3.3f1 on a very old Window 10 Education Desktop (18362).

    Tried: reinstall Windows SDK; Deleting Library Folder; Reimport all assets. None worked.

    The failure seems to be related to a particular script in my project which you can see here. However I have no idea why this script is causing issue. It looks fine. If I create a fresh project that has this script it is able to be built without problem.

    Error message in console:
    upload_2023-5-8_2-3-44.png

    Details for the first console error:

    Code (CSharp):
    1. Building Library\Bee\artifacts\WinPlayerBuildProgram\u1oik\qtrz_ly-CSharp1.obj failed with output:
    2. Assembly-CSharp1.cpp
    3. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18981): error C2065: 'FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70': undeclared identifier
    4. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18981): error C2065: 'V_0': undeclared identifier
    5. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18996): error C2065: 'V_0': undeclared identifier
    6. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18996): error C2065: 'FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70': undeclared identifier
    7. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18996): error C2059: syntax error: ')'
    8. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18997): error C2065: 'FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70': undeclared identifier
    9. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18997): error C2065: 'L_2': undeclared identifier
    10. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18997): error C2065: 'V_0': undeclared identifier
    11. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18998): error C2065: 'FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70': undeclared identifier
    12. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18998): error C2059: syntax error: ')'
    13. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18999): error C2065: 'FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70': undeclared identifier
    14. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(18999): error C2059: syntax error: ')'
    15. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19048): error C2065: 'HashSet_1_tA1368DD5977A2271895CEEC3D6282C68C9675735': undeclared identifier
    16. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19048): error C2065: 'V_0': undeclared identifier
    17. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19063): error C2065: 'V_0': undeclared identifier
    18. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19063): error C2065: 'HashSet_1_tA1368DD5977A2271895CEEC3D6282C68C9675735': undeclared identifier
    19. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19063): error C2059: syntax error: ')'
    20. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19064): error C2065: 'HashSet_1_tA1368DD5977A2271895CEEC3D6282C68C9675735': undeclared identifier
    21. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19064): error C2065: 'L_2': undeclared identifier
    22. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19064): error C2065: 'V_0': undeclared identifier
    23. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19065): error C2065: 'HashSet_1_tA1368DD5977A2271895CEEC3D6282C68C9675735': undeclared identifier
    24. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19065): error C2059: syntax error: ')'
    25. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19066): error C2065: 'HashSet_1_tA1368DD5977A2271895CEEC3D6282C68C9675735': undeclared identifier
    26. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19066): error C2059: syntax error: ')'
    27. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19331): error C3477: a lambda can only appear in an unevaluated context with '/std:c++20' or later
    28. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(19428): error C3477: a lambda can only appear in an unevaluated context with '/std:c++20' or later
    29. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(20748): error C3477: a lambda can only appear in an unevaluated context with '/std:c++20' or later
    30. D:\Projects\Unity\THYG\Library\Bee\artifacts\WinPlayerBuildProgram\il2cppOutput\cpp\Assembly-CSharp1.cpp(21133): error C3477: a lambda can only appear in an unevaluated context with '/std:c++20' or later
    31. UnityEditor.GenericMenu:CatchMenu (object,string[],int)
     
    Last edited: May 9, 2023
  2. Reimirno7

    Reimirno7

    Joined:
    Nov 25, 2021
    Posts:
    51
    Ok it is not that script. It is one of the functions in my code that uses that class as an out parameter. The C# function looks like this:

    Code (CSharp):
    1. [Server]
    2. public bool GetBattleUnitWithTag(
    3.             BattleUnitRelationTag tag,
    4.             out FixedSizeLinkedList<BattleUnit> lst
    5. )
    6. {
    7.             //businesslogic...
    8. }
    The
    [Server]
    attribute (which comes from Mirror Networking plugin) when used with a function having
    out
    parameter seems to confuse IL2CPP.

    I digged through the generated cpp code and found that IL2CPP decides that there are two
    FixedSizeLinkedList<T>
    types (one is called
    FixedSizeLinkedList_1_t3EAA698F222717A950BC3D871BB65D51F83F6B70
    another similarly looking type that starts with
    FixedSizeLinkedList_1_t
    ) for some reason; hence the syntax complaint on Cpp side.

    Refactor the code to not using
    out
    parameter, OR simply removing the
    [Server]
    attribute (it is not essential for functionalities in my case) resolves the issue.
     
  3. Reimirno7

    Reimirno7

    Joined:
    Nov 25, 2021
    Posts:
    51