简体   繁体   English

cpp的新手,如何运行messagepack?

[英]new to cpp , how do I run messagepack?

I am new to visual studio and c++ . 我是Visual Studio和C ++的新手。 I have downloaded MessagePack for c/cpp and opened the file "msgpack_vc8.vcproj" it opened a visual studio project with a bunch of c files and hpp file. 我已经下载了适用于c / cpp的MessagePack,并打开了文件“ msgpack_vc8.vcproj”,它打开了带有一堆c文件和hpp文件的Visual Studio项目。

now , I would like to see an example of how Message Pack serializes and deserializes data. 现在,我想看一个有关Message Pack如何序列化和反序列化数据的示例。

so I created a new cpp file called main and copied the example provided here: 因此,我创建了一个名为main的新cpp文件,并复制了此处提供的示例:

Github messagepack Github消息包

I built the solution and when I try to run it pops up this window : 我构建了解决方案,当我尝试运行该解决方案时,会弹出以下窗口:

在此处输入图片说明

and I have no idea how to run the file , what should I do there? 我不知道如何运行该文件,该怎么办?

I assume msgpack.vcproj is a LIBRARY project. 我假设msgpack.vcproj是一个LIBRARY项目。 You need an APPLICATION project to run and debug it. 您需要一个APPLICATION项目来运行和调试它。

If you are using a third-party library usually you would create a new Visual Studio application project, which contains at least a main.cpp with a main function. 如果您使用的是第三方库,通常会创建一个新的Visual Studio应用程序项目,该项目至少包含带有main函数的main.cpp。 Then you would include and link the msgpack library to your project. 然后,您将包括msgpack库并将其链接到您的项目。 That's what your link suggested: 这就是您的链接建议的内容:

Include msgpack.hpp header and link msgpack library to use MessagePack on your program. 包括msgpack.hpp标头并链接msgpack库以在程序上使用MessagePack。

Unless you plan to develop msgpack itself, you probably won't need msgpack.vcproj directly 除非您打算自己开发msgpack,否则可能不需要直接使用msgpack.vcproj

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM