首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >奇怪的转储导出表

奇怪的转储导出表
EN

Stack Overflow用户
提问于 2010-04-07 21:18:41
回答 1查看 1.6K关注 0票数 0

我正在互操作一个c++动态链接库,并试图访问它的函数。下面是dll的转储/exports输出:

代码语言:javascript
复制
Dump of file C:\C#Processes\SummarizerApp\SummarizerApp\lib\summarizer37.dll
File Type: DLL
Section contains the following exports for summarizer37.dll

00000000 characteristics
458962FF time date stamp Wed Dec 20 11:21:19 2006
    0.00 version
       1 ordinal base
       4 number of functions
       4 number of names

ordinal hint RVA      name

      1    0 00002960 ?delete_summarization@inxight@@YAXPAVsummarization_interface@1@@Z
      2    1 00016240 ?delete_summarizer@inxight@@YAXPAVsummarizer_interface@1@@Z
      3    2 000105E0 ?make_summarization@inxight@@YAPAVsummarization_interface@1@AAVsummarizer_interface@1@AAVbyte_stream_interface@1@ABVsummarization_input_options@1@ABVsummarization_sentence_output@1@ABVsummarization_phrase_output@1@PBDI5@Z
      4    3 0001BC40 ?make_summarizer@inxight@@YAPAVsummarizer_interface@1@PBD00@Z

Summary

    4000 .data
    B000 .rdata
    4000 .reloc
   2E000 .text

请注意序数#3。它包括我需要调用的几个方法,特别是:

make_summarization

summarization_input_options

summarization_sentence_output

summarization_phrase_output

我已经完成了这个dll的JNI包装,并且知道上面的函数(它们都是类构造器)可以从JNI使用的"extern C“中以未损坏的形式获得。我可以使用dllimport的调用约定属性来访问它们吗?

在C++世界中,以相同的顺序导出多个函数意味着什么?访问它们的方法是什么?谢谢,吉姆

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-04-07 21:53:14

DllImport属性的EntryPoint字段可用于import functions by ordinal (使用#作为序号的前缀)。

它也可以用于import functions by their mangled name

如果您真的为C++库公开的所有功能都使用了纯“外部C”包装器,那么这就很容易了。

如果不这样做,您可以构造C++/CLI包装器来在托管和非托管之间架起桥梁。

vc\bin文件夹中的undname.exe可用于拆分已编译的C++名称:

代码语言:javascript
复制
class inxight::summarization_interface * __cdecl inxight::make_summarization(
   class inxight::summarizer_interface &,
   class inxight::byte_stream_interface &,
   class inxight::summarization_input_options const &,
   class inxight::summarization_sentence_output const &, 
   class inxight::summarization_phrase_output const &,
   char const *, unsigned int , char const *)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2592690

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档