dhbaird / easywsclient

A short and sweet WebSocket client for C++
MIT License
751 stars 204 forks source link

VS ERROR LNK2001 Unresolved external symbol easywsclient::WebSocket::from_url #89

Closed ronvar closed 4 years ago

ronvar commented 5 years ago

I believe there is an issue when trying to establish a client connection using from_url(url_name); when trying to build using VS.

Severity    Code    Description Project File    Line    Suppression State   Suppression State
Error   LNK2001 unresolved external symbol "public: static class easywsclient::WebSocket * __cdecl easywsclient::WebSocket::from_url(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?from_url@WebSocket@easywsclient@@SAPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00@Z)   proj_folder_name    C:\UPath\To\File.obj    1       

Does not allow for a successful build as a result. Windows 10 x64. VS 16.

anurag-patnaik commented 4 years ago

Adding solution here for anyone else who might be seeing this error, if you are seeing this when running the example code in VS, you also need to include easywsclient.cpp file which is commented out by default: https://github.com/dhbaird/easywsclient/blob/master/example-client-cpp11.cpp#L4