IL2CPP build error in 0.4.3.9: Redefinition of parameter '__callback'

Options
chr
chr
edited November 2015 in Photon Bolt
I get two of these errors in the files:

Classes/Native/bolt_Bolt_AddCallbackMethodDeclarations.h (line 36)
Classes/Native/Bulk_bolt_0.cpp (line 1074)

It seems to be the same function (AddCallback_BeginInvoke_m2337). Also, I had this error in earlier versions so it's not a new thing.

Has anyone encountered this?

Edit: This only happens when using IL2CPP

Comments

  • chr
    chr
    edited November 2015
    Options
    This is how the method looks
    extern "C" Object_t * AddCallback_BeginInvoke_m2337 (AddCallback_t44 * __this, Action_t14 * ___callback, AsyncCallback_t235 * ___callback, Object_t * ___object, const MethodInfo* method)
    {
    	void *__d_args[2] = {0};
    	__d_args[0] = ___callback;
    	return (Object_t *)il2cpp_delegate_begin_invoke((Il2CppDelegate*)__this, __d_args, (Il2CppDelegate*)___callback, (Il2CppObject*)___object);
    }
    As you can see there are two parameters called ___callback
  • stanchion
    Options
    How do I reproduce this error?
  • Tobias
    Options
    Also, which version of Unity do you use?
  • chr
    chr
    edited November 2015
    Options
    1. Create new project
    2. Import bolt from Asset Store (everything)
    3. Restart Unity
    4. Install bolt
    5. Restart Unity
    6. Compile Assembly
    7. iOS scripting backend: IL2CPP (already set to this)
    8. Add Level1 to 'scenes to build'
    9. Build & Run (for iOS)
    10. Receive build errors in Xcode
  • chr
    Options
    I'm using Unity 5.2.2f1

    This has happened in earlier versions as well (of both bolt and Unity)
  • Tobias
    Options
    Before v0.4.3.9, IL2CPP builds were always failing. Now they should work but maybe you need the latest version of Unity, too. Can you try Unity 5.2.2p4?
    Which version of XCode do you run?
  • chr
    Options
    Xcode Version 7.1.1 (7B1005)
    I'll try updating Unity (although I updated it two days ago)
  • seaders
    Options
    Hey guys, @Tobias in particular, there's something wrong with the released build, compared to the one you got to me last week.

    This error is being caused by the function in bolt.dll,

    Bolt.AddCallback.BeginInvoke

    In the live build, the signature of this method is,

    public virtual extern IAsyncResult BeginInvoke(Action callback, AsyncCallback callback, object object);

    I'm not sure exactly how that dll got compiled, but there's obviously some funky compiler stuff going on there. That's why, when the IL2CPP compiler does it's magic, it has duplicate names, that's down to the signature of the method.

    In the dll you got me, the signature was,

    public virtual extern IAsyncResult BeginInvoke(Action callback, AsyncCallback __callback, object object);

    Also (this is the first time I got the live, released build), just checking the file that was causing the other IL2CPP error,
    Assets/bolt/scripts/udpkit/Native/PInvoke.cs
    The problematic methods,
      [DllImport(DLL_NAME)]
      [SuppressUnmanagedCodeSecurity]
      public static extern Int32 SendTo(IntPtr socket, [Out] byte[] buffer, int size, UdpEndPoint.Native addr);
    
      [DllImport(DLL_NAME)]
      [SuppressUnmanagedCodeSecurity]
      public static extern Int32 RecvFrom(IntPtr socket, [Out] byte[] buffer, int size, [Out] out UdpEndPoint.Native addr);
    Don't have the fixes in,
      [DllImport(DLL_NAME)]
      [SuppressUnmanagedCodeSecurity]
      public static extern Int32 SendTo(IntPtr socket, byte[] buffer, int size, UdpEndPoint.Native addr);
    
      [DllImport(DLL_NAME)]
      [SuppressUnmanagedCodeSecurity]
      public static extern Int32 RecvFrom(IntPtr socket, [In,Out] byte[] buffer, int size, [Out] out UdpEndPoint.Native addr);
  • stanchion
    Options
    @chr it looks like only half the fix made it into 0.4.3.9, I will see if I can make you a build so you can use iOS before the next release, You can also make a build if you have Github access and add the .xml file in the Bolt root of 0.4.3.9
  • chr
    Options
    @stanchion I don't think I have Github access to the latest versions of Bolt, but I tried manually removing the Out and adding in the In. It gives the same build errors.
  • chr
    Options
    The bolt I have access to hasn't been changed since Sept 2 -- except for the IL2CPP fix yesterday.
  • stanchion
    Options
    @chr we'll make sure the Github gets updated and the IL2CPP fix gets in for the next build
  • chr
    Options
    Sounds good. What's the ETA?
  • Tobias
    Options
    I try to squeeze out a new version today or early next week. Asap.
  • Tobias
    Options
    Sorry, this didn't happen today. It was a very busy day by surprise.
    It's high prio and it should happen early next week.
  • Tobias
    Options
    Just to let you know: We're making progress on this. We're still in the dark why this particular issue popped up and why it wasn't present in 0.4.3.7. but we might have a workaround at least.
    If you wonder why this seemingly simple thing takes longer (again): We didn't spend all day on this, as we misjudged the issue.
  • Tobias
    Options
    We released 0.4.3.10 which has all known build issues fixed.
  • chr
    Options
    Tobias said:

    Just to let you know: We're making progress on this. We're still in the dark why this particular issue popped up and why it wasn't present in 0.4.3.7. but we might have a workaround at least.
    If you wonder why this seemingly simple thing takes longer (again): We didn't spend all day on this, as we misjudged the issue.

    Don't worry about it -- stanchion has kept me updated.

    I've had the same errors happen in versions before 0.4.3.7.

    I'll be testing 0.4.3.10 tonight and will report back
  • chr
    Options
    @Tobias @stanchion Good news! No build errors in 0.4.3.10. I'll be doing a more thorough testing when I update bolt in the game I'm working on