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.

Question Build failed for UWP due to

Discussion in 'Windows' started by rk913, Jul 2, 2020.

  1. rk913

    rk913

    Joined:
    Jun 1, 2020
    Posts:
    5
    Hi,

    So I've been building an app for the HoloLens that will let me run queries on Kusto/Azure Data Explorer (using the Kusto.Data and Kusto.Cloud.Platform DLL files). When I start the build on Visual Studio, it fails with the following log statements:

    My guess is that the unresolved external symbol sched_getcpu is causing most of the other issues, but I am not exactly sure on how to proceed from here.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,529
    sched_getcpu is a Linux function, and naturally isn't available on Windows. Which file is "CurrentProcessor_GetMonoProcessorNumber_m9B3E4FB2EBA16B2E9D931E41EFE0B8C13309D5FF" function located in the generated Visual Studio project?
     
  3. rk913

    rk913

    Joined:
    Jun 1, 2020
    Posts:
    5
    sched_getcpu.png

    This is where I was able to find it in the project. It seems to be in the IL2CppOutputProject file and I think is being converted from the Kusto.Cloud.Platform file?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,529
    Yeah. Is Kusto.Cloud.Platform.dll a precompiled DLL in your project?
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,529
    An easy workaround would be to implement this function in your project in a .cpp file:

    Code (csharp):
    1. #include <windows.h>
    2.  
    3. extern "C" unsigned int __stdcall sched_getcpu()
    4. {
    5.     return GetCurrentProcessorNumber();
    6. }
     
  6. rk913

    rk913

    Joined:
    Jun 1, 2020
    Posts:
    5
    Thank you so much, I will try this out! Where in the project/build folder should I save that file?
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,529
    Anywhere within the Assets folder (or any of its subdirectories) in your Unity project. Make sure to also click on it and configure its inspector so it's only included on UWP and Windows platforms, as it will fail the build on Linux/Mac/Android/iOS/etc.
     
  8. rk913

    rk913

    Joined:
    Jun 1, 2020
    Posts:
    5
    Thank you so much! I just tried this out and was able to get it to work!