Closed rasikhq closed 3 years ago
can you try the develop version?
I was firstly on master, then I switched to develop and it still didn't resolve it.
it looks like a c++ standards mismatch, can you make sure that the library and the program being linked are using the same c++ version or both are running C++ versions higher then 17.
Well changed my CMAKE config file to
set (CMAKE_CXX_STANDARD 20)
Both the program and sleepy-discord project are set to /std:c++latest (previously were /std:c++17)
and uhhhh funnily I'm getting more errors now.
if you want to, you can try to enforce the use of string_view, there used to be a memory usage difference but not sure if that's still the case since a number of overhauls to json parsing. set the following preprocessor define for both the target and the shared library. nssv_CONFIG_SELECT_STD_STRING_VIEW
defined here https://github.com/yourWaifu/sleepy-discord/blob/5682d4dc52d38ee16fb8f57fddf43d334467a360/include/sleepy_discord/nonstd/string_view.hpp#L24
Defined it for both the library and the program projects, still didn't help.
Just to mention that the extra errors are related to strings like
So at this point the library is failing to compile so the .lib isn't generating to link with the program.
hmm might need to add #include <string>
to the top of json_wrapper.cpp. or the wrong c++ version was set.
So I added the #include <string>
in json_wrapper.cpp which got rid of the to_string error. However this is showing up when sleepy-discord.lib is being generated:
And then when I link sleepy-discord.lib with the program, it ends up failing because now there's a redefinition
I don't know what happened but now it just compiled successfully. I haven't changed anything in terms of configuration and stuff... so yeah closing it but thanks for trying to help me out.
Hey, I've been using this library for quite a while now and recently ran into a weird issue.
Check out this sample code:
Causes:
on GCC (When loading the DLL)
The linking completely fails on MSVC. The project builds and links on GCC but throws an exception (similar to msvc) when loading the bot DLL so basically its failing on both MSVC and GCC.
Any help would be appreciated.