Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 在VisualC中设置botan++;_Visual Studio_Visual C++_Cryptography_Pkcs#11_Botan - Fatal编程技术网

Visual studio 在VisualC中设置botan++;

Visual studio 在VisualC中设置botan++;,visual-studio,visual-c++,cryptography,pkcs#11,botan,Visual Studio,Visual C++,Cryptography,Pkcs#11,Botan,出于某种原因,我使用botan连接到PKCS11硬件令牌。我是C++的新手,想用Visual Studio 2019编写代码。p> 我下载了botan源代码,并用nmake构建了源代码。生成完成后,将创建一个名为build的文件夹 我将botan目录添加到VC++目录[右键单击应用程序-->属性-->VC++目录] #include <iostream> #include <botan\botan.h> #include <botan\alg

出于某种原因,我使用botan连接到PKCS11硬件令牌。我是C++的新手,想用Visual Studio 2019编写代码。p> 我下载了botan源代码,并用nmake构建了源代码。生成完成后,将创建一个名为build的文件夹

我将botan目录添加到VC++目录[右键单击应用程序-->属性-->VC++目录]

    #include <iostream>
    #include <botan\botan.h>
    #include <botan\alg_id.h>
    #include <external\pkcs11t.h>
    #include <external\pkcs11f.h>
    #include <external\pkcs11.h>


   int main() {

    Botan::Dynamically_Loaded_Library pkcs11_module("C:\\pkcs11-middleware\\library.dll");
    Botan::PKCS11::FunctionListPtr func_list = nullptr;
    Botan::PKCS11::LowLevel::C_GetFunctionList(pkcs11_module, &func_list);
    Botan::PKCS11::LowLevel p11_low_level(func_list);


   }
#包括
#包括
#包括
#包括
#包括
#包括
int main(){
Botan::动态加载的库pkcs11模块(“C:\\pkcs11中间件\\Library.dll”);
Botan::PKCS11::FunctionListPtr func_list=nullptr;
Botan::PKCS11::LowLevel::C_GetFunctionList(PKCS11_模块和函数列表);
Botan::PKCS11::低级别p11\u低级别(功能列表);
}
这些行中有错误

  • 命名空间Botan没有成员“动态加载的库”

    Botan::动态加载的\u库

  • 后跟“::”的名称必须是类或命名空间

所有的线路都有错误,我真的搞错了。我们将不胜感激

  • 构建植物学源代码:
  • 1-1。visual studio 2019的Open developer命令提示符

    1-2。python“c:\botan\configure.py”--cc=msvc--cp=i386

    1-3。恩马克

    1-4。python“c:\botan\install.py”

    1-5。nmake安装

  • 右键单击visual studio-->属性-->VC++目录中的应用程序
  • 2-1。包含目录:添加C:\Botan\Include\Botan-2

    2-2。库目录:添加C:\Botan\lib

  • 在visual studio中的应用程序上单击鼠标右键-->属性-->链接器-->输入-->其他依赖项-->添加botan.lib

  • 不要忘记将调试模式设置为x86

  • 感谢@Alexander,我应该包含“p11.h”并使用名称空间PKCS11定义

  • 重建项目:)


  • 你是不是根据你拼写错误的botan创建了boton标签?在任何情况下都不要键入代码或错误消息:始终复制并粘贴。请用复制的错误编辑您的问题,不要拼写错误,手工输入的materialI我不熟悉Botan,但它似乎位于@James K Polk中,动态加载的库,谢谢您的评论。我编辑了问题。请在自己的测试中检查使用。与您的错误无关,但据我所知,PKCS#11头必须通过
    cryptoki.h
    文件包含。