Search Unity

Trouble to use RakNet as shared library on Linux and Android

Discussion in 'Multiplayer' started by weyzohorth, Aug 23, 2013.

  1. weyzohorth

    weyzohorth

    Joined:
    Jul 1, 2013
    Posts:
    7
    Hi,

    I come to you, because I didn't succeed to found a solution myself, and I need some help to continue.

    I'm looking to make RakNet works on Linux. It works pretty well on Windows, but it's been during two weeks, i'm trying to make the same on Android and Linux.
    The issue seems to be that Unity can't find the entry point of the library.
    I followed the RakNet tutorial to make it, but it still not working. And google wasn't very helpful this time.

    Here, the Exception thrown (with its multiple inner exceptions):
    Code (csharp):
    1.  
    2. Exception: System.TypeInitializationException: An exception was thrown by the type initializer for RakNet.RakNetPINVOKE ---> System.TypeInitializationException: An exception was thrown by the type initializer for SWIGExceptionHelper ---> System.EntryPointNotFoundException: SWIGRegisterExceptionCallbacks_RakNet
    3.   at (wrapper managed-to-native) RakNet.RakNetPINVOKE/SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_RakNet (RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate)
    4.   at RakNet.RakNetPINVOKE+SWIGExceptionHelper..cctor () [0x000ee] in C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\RakNet\RakNetPINVOKE.cs:106
    5.   --- End of inner exception stack trace ---
    6.   at RakNet.RakNetPINVOKE..cctor () [0x00000] in <filename unknown>:0
    7.   --- End of inner exception stack trace ---
    8.   at RakNet.RakPeerInterface.GetInstance () [0x00000] in C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\RakNet\RakPeerInterface.cs:69
    9.   at PCNetwork.connect () [0x00015] in C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\EIS\NetworkPrefab\PCNetwork.cs:12
    10.   at ANetwork.Awake () [0x00077] in C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\EIS\Abstract\ANetwork.cs:72
    11. Assembly-CSharp: An exception was thrown by the type initializer for RakNet.RakNetPINVOKE
    12.  
    13.   at RakNet.RakPeerInterface.GetInstance () [0x00000] in C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\RakNet\RakPeerInterface.cs:69
    14.   at PCNetwork.connect () [0x00015] in C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\EIS\NetworkPrefab\PCNetwork.cs:12
    15.   at ANetwork.Awake () [0x00077] in C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\EIS\Abstract\ANetwork.cs:72
    16. UnityEngine.Debug:Internal_Log(Int32, String, Object)
    17. UnityEngine.Debug:Log(Object)
    18. ANetwork:error(Exception) (at C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\EIS\Abstract\ANetwork.cs:86)
    19. ANetwork:Awake() (at C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\EIS\Abstract\ANetwork.cs:78)
    20.  
    21. (Filename: C Line: 0)
    22.  
    23. Exception: System.TypeInitializationException: An exception was thrown by the type initializer for SWIGExceptionHelper ---> System.EntryPointNotFoundException: SWIGRegisterExceptionCallbacks_RakNet
    24.   at (wrapper managed-to-native) RakNet.RakNetPINVOKE/SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_RakNet (RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate)
    25.   at RakNet.RakNetPINVOKE+SWIGExceptionHelper..cctor () [0x000ee] in C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\RakNet\RakNetPINVOKE.cs:106
    26.   --- End of inner exception stack trace ---
    27.   at RakNet.RakNetPINVOKE..cctor () [0x00000] in <filename unknown>:0
    28. Assembly-CSharp: An exception was thrown by the type initializer for SWIGExceptionHelper
    29.  
    30.   at RakNet.RakNetPINVOKE..cctor () [0x00000] in <filename unknown>:0
    31. UnityEngine.Debug:Internal_Log(Int32, String, Object)
    32. UnityEngine.Debug:Log(Object)
    33. ANetwork:error(Exception) (at C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\EIS\Abstract\ANetwork.cs:86)
    34. ANetwork:Awake() (at C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\EIS\Abstract\ANetwork.cs:78)
    35.  
    36. (Filename: C Line: 0)
    37.  
    38. Exception: System.EntryPointNotFoundException: SWIGRegisterExceptionCallbacks_RakNet
    39.   at (wrapper managed-to-native) RakNet.RakNetPINVOKE/SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_RakNet (RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate)
    40.   at RakNet.RakNetPINVOKE+SWIGExceptionHelper..cctor () [0x000ee] in C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\RakNet\RakNetPINVOKE.cs:106
    41. Assembly-CSharp: SWIGRegisterExceptionCallbacks_RakNet
    42.  
    43.   at (wrapper managed-to-native) RakNet.RakNetPINVOKE/SWIGExceptionHelper:SWIGRegisterExceptionCallbacks_RakNet (RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate,RakNet.RakNetPINVOKE/SWIGExceptionHelper/ExceptionDelegate)
    44.   at RakNet.RakNetPINVOKE+SWIGExceptionHelper..cctor () [0x000ee] in C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\RakNet\RakNetPINVOKE.cs:106
    45. UnityEngine.Debug:Internal_Log(Int32, String, Object)
    46. UnityEngine.Debug:Log(Object)
    47. ANetwork:error(Exception) (at C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\EIS\Abstract\ANetwork.cs:86)
    48. ANetwork:Awake() (at C:\Users\weyzohorth\Documents\prog\Unity Projects\Animate Client - Mobile\Assets\Network\Scripts\EIS\Abstract\ANetwork.cs:78)
    49.  
    I'm wondering, there is a particular place where I should let my library ?
    I guess, it should be in the same directory than the executable, but I can't find it out (And that should be pretty annoying to on Android).

    Do you have any ideas ?
    I'm really lost =|

    See you,

    Edit: I solved my problem. I try to rebuid and rebuild the shared library. To find, I just missed a step each time I made the library...
    What a waste of time -.-

    Sorry, to bother you with that =/
     
    Last edited: Aug 27, 2013
  2. Stankiem

    Stankiem

    Joined:
    Dec 4, 2013
    Posts:
    115
    Hey Wehzorth,

    I am sorry but I'm having the exact same problem and your solution is a little vague to me with my limited knowledge of programming. Could you please go into detail on what step you missed when creating the library and what you did to correct it? Thank you so much!
     
  3. FlyingHighUp

    FlyingHighUp

    Joined:
    Apr 23, 2012
    Posts:
    16
    Hey Stankiem, I also have this same problem. I've been at this for days! Did you happen upon a solution?

    Good news, I figured it out.
    There's a bajillion things that could have gone wrong. Mine was needing to rename RakNet_wrap.cxx to RakNet_wrap.cpp so it was included in the Android build.

    I wrote about it in the source over on this forum https://forum.unity3d.com/threads/r...-through-and-more.395835/page-13#post-3022093
     
    Last edited: Apr 6, 2017
    Stankiem and thegreatzebadiah like this.