Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Bug Build Fail: use of undeclared identifier 'semaphore'

Discussion in 'Linux' started by SharpAccent, Jun 5, 2023.

  1. SharpAccent

    SharpAccent

    Joined:
    Jul 19, 2018
    Posts:
    43
    Hi,
    I'm trying to make a Linux build on a project but the build fails with this messages"

    Library\Bee\artifacts\LinuxPlayerBuildProgram\zbz95\kovg_eSemaphore.o failed with output: {project_dir}\Library\Bee\artifacts\LinuxPlayerBuildProgram\il2cppOutput\cpp\NativeSemaphore.c:43:15: error: use of undeclared identifier 'semaphore' sem_init(&semaphore->sem, 0, 0);

    ^ {project_dir}\Library\Bee\artifacts\LinuxPlayerBuildProgram\il2cppOutput\cpp\NativeSemaphore.c:46:12: error: use of undeclared identifier 'semaphore' return semaphore;

    ^ {project_dir}\Library\Bee\artifacts\LinuxPlayerBuildProgram\il2cppOutput\cpp\NativeSemaphore.c:58:25: error: use of undeclared identifier 'errno' } while (r == -1 && errno == EINTR);

    ^ {project_dir}\Library\Bee\artifacts\LinuxPlayerBuildProgram\il2cppOutput\cpp\NativeSemaphore.c:58:34: error: use of undeclared identifier 'EINTR' } while (r == -1 && errno == EINTR); ^ 4 errors generated. UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Where do I even start to look into these? There aren't really any results coming up on google :(
     
  2. ChiwTheNeko

    ChiwTheNeko

    Joined:
    Mar 24, 2022
    Posts:
    150
    Are these the very first errors you get when trying to build or are there other before?
     
  3. SharpAccent

    SharpAccent

    Joined:
    Jul 19, 2018
    Posts:
    43
    yeap first ones
     
  4. ChiwTheNeko

    ChiwTheNeko

    Joined:
    Mar 24, 2022
    Posts:
    150
    Just to be sure, is there a reason you're using the IL2CPP backend? Mono is easier to work with in most cases.

    I tried making an IL2CPP build here and it worked but I didn't get the NativeSemaphore.c file. Which version of Unity are you using?

    I guess the best thing to do now would be to look at the NativeSemaphore.c to see what the problem is.
     
  5. SharpAccent

    SharpAccent

    Joined:
    Jul 19, 2018
    Posts:
    43
    Yeah, we using Photon's quantum so il2cpp is a requirment. Version 2021.3.25f1
     
  6. ChiwTheNeko

    ChiwTheNeko

    Joined:
    Mar 24, 2022
    Posts:
    150
    I used the same Unity version as you and I didn't get the NativeSemaphore.c file. Maybe it was generated by quantum or something else you're using.