安装socket.io C ++ [英] Installing socket.io C++
问题描述
我尝试在C ++中使用socket.io,但似乎无法运行该示例.首先,它要求我将项目转换为我的视觉工作室(2015年).所以我做到了.然后,它缺少了库功能(boost,websocket ++,rapidjson).因此,我将它们添加到了项目设置中的其他库中.然后,它正在搜索boost.lib.我在PC上安装的boost库中不存在Boost.lib,因此我从依赖项列表中将其删除.我以为我已经包含了boost,为什么它会搜索不存在的lib.我从boost运行了bjam.exe和b2.exe等,因此,如果有boost.lib,我猜应该在那里,而不是.
然后我收到此错误:
由于 VC ++
版本,我认为很多错误.项目 Socket.io-c ++
的创建者,他使用了 VC ++ 11.0
如果使用 VC ++ 14.0
进行构建,则会收到错误消息.提出建议,您应该使用 VC ++ 12.0
在演员表中,您想使用预构建的库:
我本人只是尝试许多解决方案,天哪,我解决了所有问题
您可以在此处获取它们 Prebuilt-libraries-for-Socket.io-c ++
对于Visual Studio 2015,您需要的是:
- 安装更多
Visual Studio 2013
(我安装Visual Studio 2013社区
)以获得VC ++ 12.0
(prebuilt-lib是内置于VC ++ 12.0
) - 将项目平台工具集更改为Visaul Studio 2013(v120)
- 将库链接到您的项目
您需要的图书馆是:
libboost_date_time-vc120-mt-gd-1_50.lib
libboost_random-vc120-mt-gd-1_50.lib
libboost_system-vc120-mt-gd-1_50.lib
sioclient.lib
将* .h( Socket.io-C ++
的标题)的文件夹包含到您的项目中
构建并运行
I try to work with socket.io in C++ but I can't seem to get the example running. First it asked me to convert the project to my visual studio (which is 2015). So I did that. Then it was missing libraries offcourse (boost, websocket++, rapidjson). So I added them to the additional libraries in the project settings. Then it was searching for boost.lib. Boost.lib doesnt exist in the boost library I installed on my pc, so I deleted it from the dependency list. I figured I already included boost, why would it search for a lib that doesn't exist. I ran bjam.exe and b2.exe etc from boost, so if there would be a boost.lib it should be there I guess and it isn't.
I then got this error: https://msdn.microsoft.com/en-us/library/f6xx1b1z.aspx So I added msvcrt.lib and msvcmrt.lib to the linker's Additional Dependencies property. Which caused the errors in the included image..
Now all the steps seemed to fix the problems I had, but also create more errors in the process. I do not understand how to run a project like this and I can't find a good explanation of the steps I need to take.
Can anyone explain what I am doing wrong?
https://github.com/socketio/socket.io-client-cpp
That is what I try to run, the included SioChatExample
Thanks for any help in advance!
Current errors..... :(
i think many errors because of VC++
version.
creator of project Socket.io-c++
, he used VC++ 11.0
if you use VC++ 14.0
to build it, you will get the error. for suggestion you should use VC++ 12.0
In cast you want to use prebuilt libraries:
i myself just try many solutions, goodness i fix all
you can get them here Prebuilt-libraries-for-Socket.io-c++
for Visual Studio 2015, what u need are:
- install more
Visual Studio 2013
(i installVisual Studio 2013 community
) to getVC++ 12.0
(prebuilt-lib is built inVC++ 12.0
) - change your project Platform Toolset to Visaul Studio 2013 (v120)
- link libraries to your project
libraries you need are:
libboost_date_time-vc120-mt-gd-1_50.lib
libboost_random-vc120-mt-gd-1_50.lib
libboost_system-vc120-mt-gd-1_50.lib
sioclient.lib
include folder of *.h (header of Socket.io-C++
) to your project
build and run
这篇关于安装socket.io C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!