c++ - 如何添加宏Visual Studio 2019

标签 c++ visual-studio-2019 packet-sniffers libtins

我正在尝试制作一个程序来嗅探数据包并去libtins

If you are using a static build of libtins on Windows, then you have link your application with tins.lib. You also need to add this macro definition to your project: TINS_STATIC



这是什么意思?它甚至没有值(value)。有人可以帮我如何在Visual Studio中添加它吗?

这是否意味着
#define TINS_STATIC

最佳答案

有关在Visual Studio中使用libtins的完整指南,请参见this答案。

使用#define TINS_STATIC(在包含任何libtins头文件之前)将起作用。或者,您可以在TINS_STATIC> C/C++> Preprocessor下的项目设置中添加Preprocessor definitions

它不需要值,因为libtins header 仅检查符号是否已定义,而不检查其值(reference):

// If libtins was built into a shared library
#if defined(_WIN32) && !defined(TINS_STATIC)
...
#endif // _WIN32 && !TINS_STATIC

关于c++ - 如何添加宏Visual Studio 2019,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61795754/

相关文章:

java - 使用 jpcap 获取完整的 TCP 数据包数据

c++ - #include <string> 导致大量 '<blank>' has not been declared 错误

c++ - 如何在 Visual Studio 2019 中启用 C++98 编译?

javascript - SignalR 客户端方法未从服务器端按钮单击触发

.net - 在 SSIS 2019 脚本任务中将目标框架更改为 Net 5

mysql - 使用 pcap 循环和 mysql con 作为我的参数时出错

java - 解密 TLS https 数据流量

c++ - 自动存储和异常中没有无参数构造函数的类的对象

c++ - 是否建议指定例如vector<t> 在我的公共(public)界面?

C++ 格式化输入必须匹配值