Closed StiviiK closed 5 years ago
Hi there, i've created a minimal c++17 project, to test the library on windows, but when i run the code from below i get the error fail Socket().
fail Socket()
#include <iostream> #include "cpp_redis/cpp_redis" int main(int argc, char* argv[]) { try { cpp_redis::client client; client.connect(); } catch(std::exception& e) { std::cout << e.what() << std::endl; } std::cin.get(); return 0; }
Project was generated using the following premake5 file:
project "test" language "C++" cppdialect "C++17" kind "ConsoleApp" libdirs { "lib" } vpaths { ["Headers/*"] = "**.h", ["Sources/*"] = "**.cpp", ["Test files"] = "**.json", ["*"] = "premake5.lua" } files { "premake5.lua", "**.cpp", "**.h", } filter { "system:windows", "platforms:x86" } links { "tacopie.lib" } links { "cpp_redis.lib" } filter { "system:windows", "platforms:x64" } links { "tacopie_64.lib" } links { "cpp_redis_64.lib" } filter "system:linux"
how do you deal with this problem?
Oh, i forgot that. You have to initialize the windows sockets library before: https://docs.microsoft.com/en-us/windows/win32/winsock/initializing-winsock
Hi there, i've created a minimal c++17 project, to test the library on windows, but when i run the code from below i get the error
fail Socket()
.Project was generated using the following premake5 file: