MFC调用libyara遇到的问题

测试结果

如果调用yara非要变成共享DLL的形式,加那么多的DLL,不如直接调用EXE文件。反而依赖vcruntime运行库的DLL少了很多。。。

调用libyara

调用libraya和C++调用动态链接库的基础没什么区别。

官方说明

https://yara.readthedocs.io/en/v3.4.0/capi.html

解决方法

项目->属性->配置属性->VC++ 目录-> 在“包含目录”里添加头文件yara.h所在的目录 
项目->属性->配置属性->VC++ 目录-> 在“库目录”里添加头文件libyara.lib所在的目录 
项目->属性->配置属性->链接器->输入-> 在“附加依赖项”里添加“libyara32.lib”

参考

c++动态库封装及调用(3、windows下动态库调用)

https://www.cnblogs.com/marblemm/p/7804056.html

error Please #define _AFXDLL or do not use /MD[d] occurs even after making changes in Project Properties

解决方法

Project -> "project" Properties -> Configuration Properties -> C/C++ -> Advanced -> Show Includes:YES(/showIncludes)

Project -> "project" Properties -> Configuration Properties -> General -> Project Defaults -> Use of MFC :Use MFC in a shared DLL

参考

https://stackoverflow.com/questions/25031009/error-please-define-afxdll-or-do-not-use-mdd-occurs-even-after-making-chang

猜你喜欢

转载自www.cnblogs.com/17bdw/p/10386392.html