Jump to content
Mumble forums

Building Mumble JSON Bridge


LilyC
 Share

Recommended Posts

Hello, I am attempting to build the json_bridge portion of the Mumble JSON bridge. I am using cmake 3.18 and am unsure what version of Boost I am meant to have. I know that Boost is not great with backwards compatibility, so I am curious what version of Boost should be used to build this?

Link to comment
Share on other sites

  • Administrators

Since you are building it from source, the only requirement is for your Boost version to already include the functionality that is used (the JSON Bridge does not ship with any prebuilt parts that you'd have to maintain compatibility with).

 

Iirc the functionality required from Boost is quite basic so I would assume that pretty much any version of Boost that is not completely ancient should do. If in doubt, use the latest version.

Link to comment
Share on other sites

Thank you.

 

I ended up using Boost 1.77, compiled for Win32. I am also using Visual Studio 2019 command line to build, with toolset 14.29.30037. When I try compiling, I get the following error (and other similar errors):

C:\mumble\mumble-json-bridge\json_bridge\src\NamedPipe.cpp(227): error C2664: 'Mumble::JsonBridge::FileHandleWrapper<HANDLE,BOOL (__cdecl *)(HANDLE),0xffffffff,1>::FileHandleWrapper(handle_t,close_handle_function_t)': cannot convert argument 2 from 'BOOL (__stdcall *)(HANDLE)' to 'close_handle_function_t'
        with
        [
            handle_t=HANDLE,
            close_handle_function_t=BOOL (__cdecl *)(HANDLE)
        ]
        and
        [
            close_handle_function_t=BOOL (__cdecl *)(HANDLE)
        ]
C:\mumble\mumble-json-bridge\json_bridge\src\NamedPipe.cpp(229): note: This conversion requires a reinterpret_cast, a C-style cast or function-style cast

I am currently trying to change to a newer toolset since I know FileSystem was handled differently in different versions of Visual Studio. Would you have any other suggestions of what to look into if this does not work?

Link to comment
Share on other sites

  • Administrators

@LilyC hm it seems as if the calling convention for the CloseHandle function is different for some reason.

 

Could you try changing json_bridge/src/NamedPipe.cpp:157 (https://github.com/mumble-voip/mumble-json-bridge/blob/93a2aba680f3e9579842ff5b880532ed851fda0f/json_bridge/src/NamedPipe.cpp#L157) from

using handle_t = FileHandleWrapper< HANDLE, BOOL (*)(HANDLE), INVALID_HANDLE_VALUE, true >;

to

using handle_t = FileHandleWrapper< HANDLE, decltype(&CloseHandle), INVALID_HANDLE_VALUE, true >;

 

In theory that should automatically adapt to the required type whatever it might end up being.

 

(And please let me know the result of this since in case this works, I would like this to be changed in the repo as well)

Link to comment
Share on other sites

Thank you for the quick turnaround on the fix!

 

I was able to successfully build the project. However, I was trying to install the json_bridge_plugin.dll into my locally built version of Mumble (that supports the installation of plugins), but Mumble gave me this error:

Unable to load plugin "json_bridge_plugin.dll" - check the plugin interface!

 

If I place the plugin manually into Mumble's plugin directory, I get: 

Non-plugin found in plugin directory: "C:/mumble/out/build/x86-Release/plugins/json_bridge_plugin.dll"

 

After poking around a bit, I realized that if I removed the m_bridge variable (specifically, if it is not in the constructor) in mumble-json-bridge\plugin\plugin.cpp then I am able to install the plugin. Is there a way to fix this so that the plugin can be installed properly?

 

Link to comment
Share on other sites

  • Administrators

Uhm removing m_bridge is certainly not a proper solution for this issue...

My best guess without looking into it is that there was some update to the plugin interface during the development of 1.4.0 that has not been ported to the JSON bridge yet...

Unfortunately I do not have the time to look into this myself right now but if you poke me again in about a month or so, I should be able to look into this.

 

EDIT: Did you perhaps not build with static boost libraries and the dynamic ones are not in PATH so they can't be loaded when attempting to create m_bridge?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...