c++ - 从 DLL 语法导出函数

标签 c++ dll syntax export

在 export.def 文件中可以放置这样的行:

LIBRARY plug
EXPORTS
    funcName
    main=funcName

这样导出函数有什么效果?它是否导出属于同一函数的两个函数名称?或者它只是导出函数,给它另一个名字?

最佳答案

根据 MSDN :

The EXPORTS keyword can be on the same line as the first definition or on a preceding line. The .def file can contain one or more EXPORTS statements.

The syntax for export definitions is:

entryname[=internalname] [@ordinal [NONAME]] [PRIVATE] [DATA]

entryname is the function or variable name that you want to export. This is required. If the name you export is different from the name in the DLL, specify the export's name in the DLL with internalname. For example, if your DLL exports a function, func1() and you want it to be used as func2(), you would specify:

EXPORTS func2=func1

关于c++ - 从 DLL 语法导出函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7287400/

相关文章:

c++ - 如何在基类 vector 中返回派生对象的拷贝?

c++ - -lglut32 找不到

c# - 在 C# 中使用 C CLR::Class Library

C 中的复合关系运算符

haskell - 类定义中的管道是什么意思?

c++ - 延迟初始化引用 - 用什么初始化?

c++ - 关于声明成员函数

c++ - 二维数组内存分配 (malloc) 返回 NULL

c# - System.Net.Http DLL 未复制到 bin 文件夹中 - IdentityServer4.AccessTokenValidation

bash - 如何在单引号字符串中转义单引号