#pragma mak_public()完全无效 [英] #pragma mak_public() has strictly no effect

查看:135
本文介绍了#pragma mak_public()完全无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为著名的候选功能无法使用"而苦苦挣扎了几个小时.

据我了解,#pragma make_public应该可以解决此问题,但不能解决.

这里是上下文.

负责此pb的结构来自cryptoki.h中包含的pkcs11t.h中定义的PKCS#11库.

在DLL A中:

#include"cryptoki.h"

公共裁判类ClassA

{

公开

:

ClassA(CK_ATTRIBUTE_PTR pAttr,CK_ULONG计数)

.{

//使用pAttr进行操作

}

}

在DLL B中:

#include"cryptoki.h"

公共引用类ClassB

{

公开

:

静态void MyMethod()

{{p

CK_ATTRIBUTE_PTR pAttr = CK_ATTRIBUTE [] {//初始化};

ClassA ^ classA = gcnew ClassA(pAttr,1);

}

}

在DLL B中,我得到了一个烦人的``无法访问的候选函数''(无法访问的候选函数). MyMethod中调用的ClassA的构造函数出错.

在MS的文档中,据说#pragma make_public(CK_ATTRIBUTE)应该可以解决问题.

不幸的是,在DLL A中使用它在LINK时导致一个新错误错误1错误LNK2022:元数据操作失败(80131195):自定义属性不一致:(0x0c0001a7). CryptokiAttribute.obj

并使用它DLL B完全无效.

在上述情况下,是否有人已经设法使用了这种称为解决方案的解决方案.

PS: Mike Gold 如果您看到此信息,我非常需要帮助!

解决方案

我遇到了同样的问题,但尚未解决.

奇怪的是,在我的DLL A中,有一个文件已经成功使用#pragma make_public.但是我需要的其他文件会生成该链接错误.我无法发现我成功使用该文件的文件与该文件生成错误的文件之间的任何区别...

有人知道吗?


Hi,

 

I have been struggling  for hours now with the famous "candidate function(s) not accessible" 

 

From what I understood #pragma make_public  should solve this problem but it doesn't.

 

Here is the context.

The structure which is responsible for this pb is from the PKCS#11 library defined in  pkcs11t.h included in cryptoki.h.

 

In DLL A:

#include "cryptoki.h"

 

public ref class ClassA

{

public:

    ClassA(CK_ATTRIBUTE_PTR pAttr, CK_ULONG count)

    {

        // Do something with pAttr

    }

}  

 

 

In DLL B:

#include "cryptoki.h"

 

public ref class ClassB

{

public:

      static void MyMethod()

      {

             CK_ATTRIBUTE_PTR pAttr = CK_ATTRIBUTE[] { // Initialisation};

             ClassA^ classA = gcnew ClassA(pAttr, 1);

      }

}

 

In DLL B I get the anoying "candidate function(s) not accessible candidate function(s) not accessible" error on the constructor of ClassA called in MyMethod.

 

In the documentation of MS it is said that #pragma make_public(CK_ATTRIBUTE) should solve the problem.

 

Unfortunately using this in DLL A leads to a new error at LINK time Error 1 error LNK2022: metadata operation failed (80131195) : Custom attributes are not consistent: (0x0c0001a7). CryptokiAttribute.obj

and using it DLL B has strictly no effect. 

 

Does anyone has already managed to use this s called solution in the above situation.

 

PS: Mike Gold if you see this post  I desesperately need some help!

 

解决方案

I've got the same problem, and haven't been able to solve it yet...

 

The weird thing is that, in my DLL A, there's one file where I'm already using #pragma make_public successfully. But the other files where I need it generate that link error. I haven't been able to spot any difference between the file in which I'm using it successfully, and the ones where it generates the error...

 

Anybody has an idea?


这篇关于#pragma mak_public()完全无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆