You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently uWebSockets and its dependency "uSockets" define a macro "WIN32_EXPORT" in header file "libusockets.h", as the following.
So all uSockets api functions and a uWebSockets class named "struct WIN32_EXPORT WebSocketProtocol" will appear in exe/dll export tables even if we use their static libs.
Please remove "__declspec(dllexport)" for static lib build configuration. Thanks.
As the default build system only build static libraries (#99), the easiest fix for this issue is just to define WIN32_EXPORT to an empty string also on Windows. However, at that point WIN32_EXPORT would be empty on all platforms, so probably it could make sense to just remove it altogether. I would be happy to provide a PR to remove it if that is the decision of the mantainers of the library.
Now that I think of it, who is really building DLL of uSockets? That's really crappy for performance and should never be done. uSockets should always be a static lib
Now that I think of it, who is really building DLL of uSockets? That's really crappy for performance and should never be done. uSockets should always be a static lib
Indeed, that is what I mentioned in #184 (comment) . Do you prefer to simply define WIN32_EXPORT to empty also on Windows or just get rid of WIN32_EXPORT altogether?
Now that I think of it, who is really building DLL of uSockets? That's really crappy for performance and should never be done. uSockets should always be a static lib
Indeed, that is what I mentioned in #184 (comment) . Do you prefer to simply define WIN32_EXPORT to empty also on Windows or just get rid of WIN32_EXPORT altogether?
Activity
z16166 commentedon Aug 2, 2022
Maybe we can use MSVC macro "_DLL" to detect dll build vs static lib build.
traversaro commentedon Jan 2, 2023
As the default build system only build static libraries (#99), the easiest fix for this issue is just to define
WIN32_EXPORTto an empty string also on Windows. However, at that pointWIN32_EXPORTwould be empty on all platforms, so probably it could make sense to just remove it altogether. I would be happy to provide a PR to remove it if that is the decision of the mantainers of the library.uNetworkingAB commentedon Jan 2, 2023
if you want to add that _DLL macro check under _WIN32 that's fine with me, that sounds very reasonable make PR plaes
Only define WIN32_EXPORT if LIBUS_BUILDING_DLL is defined
uNetworkingAB commentedon Jan 2, 2023
Now that I think of it, who is really building DLL of uSockets? That's really crappy for performance and should never be done. uSockets should always be a static lib
traversaro commentedon Jan 2, 2023
Indeed, that is what I mentioned in #184 (comment) . Do you prefer to simply define
WIN32_EXPORTto empty also on Windows or just get rid ofWIN32_EXPORTaltogether?traversaro commentedon Jan 3, 2023
This was handled in b950efd, thanks!