[Libwebsockets] protocol_example_standalone / Win32
joel.winarske at gmail.com
Sun Jan 29 21:08:00 CET 2017
#define LWS_EXTERN extern __declspec(dllexport)
LWS_EXTERN was missing on the plugin-standalone export functions.
- to -
LWS_EXTERN LWS_VISIBLE int
I also re-worked the CMakeLists.txt so no change is needed in the project
file prior to building.
On Sat, Jan 28, 2017 at 6:46 PM, Andy Green <andy at warmcat.com> wrote:
> On 01/29/2017 09:42 AM, Joel Winarske wrote:
>> It was missing the two exports:
>> 1. destroy_protocol_example_standalone
>> 2. init_protocol_example_standalone
>> It is a configuration issue with the VS project. After matching project
>> parameters against known good plugin it's working fine.
> That's good to hear.
>> It involves a multitude of manual steps after what CMakeLists.txt
> The cause - well, the root cause is MSVC / Windows... Microsoft... - is
> likely that I didn't chop down the main CMakeLists.txt to form the example
> one for the standalone plugin... I just put enough bits in it to make it
> work well on Linux. Windows guys from earlier have hacked the main
> CMakeLists.txt to do whatever else is needed.
> The build of the plugin doesn't actually involve anything that isn't done
> for the build of the lib... it's a DLL with exports coming out in the end
> the same. So I guess the "multitude of manual steps" are also workarounds
> for whatever the cut down CMakeLists.txt isn't doing for the Windows case
> compared to the main lws one.
>> On Sat, Jan 28, 2017 at 12:42 PM, Andy Green <andy at warmcat.com <mailto:
>> andy at warmcat.com>> wrote:
>> On 29 January 2017 03:09:34 GMT+08:00, Joel Winarske
>> <joel.winarske at gmail.com <mailto:joel.winarske at gmail.com>> wrote:
>> >I am attempting to have lwsws load plugin
>> >I'm seeing:
>> >[2017/01/28 10:43:10:2640] ERR: Failed to get init on
>> >protocol_example_standalone.dll: The specified procedure could not
>> >It loads all the other plugins built with libwebsocket without error.
>> >Any ideas?
>> The names of the exports in the plugin must match the plugin name.
>> For example 'plugin_standalone' exports
>> The other reason I can imagine is maybe no exports or decorated
>> exports from your plugin dll... you need some objdump like tool to
>> check it.
>> >Building this plugin on Windows required some fiddling:
>> >*libwebsockets plugin-standalone*
>> >1. Open VS2015 x86 Native Tools window
>> >2. cd C:\Users\joel\Documents\GitHub\libwebsockets\plugin-standalone
>> >3. mkdir build
>> >4. cd build
>> >.. -DLWS_WITH_LWSWS=1
>> >6. Open the protocol_example_standalone sln file, and update as
>> >VC++ Directories->Include Directories <append>
>> >VC++ Directories->Library Directories <append>
>> >Linker->Input <append>
>> >7. Build. you get protocol_example_standalone.dll. Drop this into
>> >lwsws plugin directory.
>> Sent from my Android device with K-9 Mail. Please excuse my brevity.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libwebsockets