- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在 Visual Studio 2008 中构建一个 C++ DLL,以供使用 Borland C++ Builder 6 编写的 C 应用程序使用。
我的调试 DLL 构建导出用下划线修饰的方法。然而,在我发布的 DLL 构建中,方法未被修饰,导致 C++ Builder 中的链接器错误。 (有关两种构建类型的 dumpbin.exe 的输出,请参见下文)
我已经检查了调试和发布配置的编译器选项,但没有发现任何可能导致此问题的因素。
我已经设法解决了这个问题。将 Visual Studio .lib 文件转换为 C++ Builder .lib 文件的 Borland 工具 implib 可以添加下划线。但我想了解为什么导出没有被装饰。
头文件methods.h
#ifndef METHODS_H
#define METHODS_H
#ifdef ENCRYPTION_EXPORTS
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C"
{
#endif
DLLEXPORT BOOL EncryptString(char *szPlain, char *szEncrypted);
DLLEXPORT BOOL DecryptString(char *szEncrypted, char *szPlain);
DLLEXPORT BOOL EncryptInitialise(void);
DLLEXPORT void EncryptExit(void);
#ifdef __cplusplus
}
#endif
#endif
用于调试构建的 Dumpbin.exe 输出
dumpbin /EXPORTS encryption.dll
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file encryption.dll
File Type: DLL
Section contains the following exports for encryption.dll
00000000 characteristics
50B8B22E time date stamp Fri Nov 30 13:18:38 2012
0.00 version
1 ordinal base
4 number of functions
4 number of names
ordinal hint RVA name
1 0 000308F7 DecryptString = @ILT+2290(_DecryptString)
2 1 00031635 EncryptExit = @ILT+5680(_EncryptExit)
3 2 000303CF EncryptInitialise = @ILT+970(_EncryptInitialise)
4 3 0003003C EncryptString = @ILT+55(_EncryptString)
Summary
5000 .data
1000 .idata
13000 .rdata
5000 .reloc
1000 .rsrc
64000 .text
2F000 .textbss
发布构建的 Dumpbin.exe 输出
dumpbin /EXPORTS encryption.dll
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file encryption.dll
File Type: DLL
Section contains the following exports for encryption.dll
00000000 characteristics
50B8BE14 time date stamp Fri Nov 30 14:09:24 2012
0.00 version
1 ordinal base
4 number of functions
4 number of names
ordinal hint RVA name
1 0 00001A10 DecryptString
2 1 000012C0 EncryptExit
3 2 00001370 EncryptInitialise
4 3 00001820 EncryptString
Summary
4000 .data
4000 .rdata
2000 .reloc
1000 .rsrc
F000 .text
最佳答案
这是一篇关于 calling conventions and name decoration 的文章.名称修饰可能会被项目中的 *.def 文件否决。
关于c++ - Visual Studio 2008 发布版本不修饰 DLL 导出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13648951/
我在使用 lambda 表达式时遇到问题,该表达式用于自定义过滤来自 DataGridView 的数据。 这是表达式: private static Expression> ExpressionLon
我想使用装饰器模式扩展 basic_streambuf 对象的行为。这就是我目前得到的: template class forwarding_basic_streambuf : boost::
我正在编写一个 Backbone 应用程序,我想编写一个经过身份验证的装饰器,我可以用它来装饰路由器类中的方法(路由)列表。 所以我有一个带有几种方法的路由器,并尝试过类似的方法。但是,当我调用我想要
我想重写 alert() Javascript 函数,同时保留它的“聚焦”行为。即,自定义方面,同时将焦点带到打开弹出窗口的浏览器选项卡。 最佳答案 无法直接自定义/装饰 JavaScript 警报框
我们如何在 jquery mobile 中实现事件行为内部的 touch up。 我希望它的行为与 native ios 按钮完全相同。我们可以点击并按住点击并在按钮内移动手指只有当我在按钮内释放时才
我正在尝试覆盖模块(connect-mongo)中的类。该模块的工作原理大致如下: 在server.js中: const session = require('express-session'); c
我希望使用托管代码在非托管 C++ DLL 上加载库,然后在已损坏的外部函数上调用 GetProcAddress。我的问题是,您从 C++ 编译器获得的错位名称是否具有确定性?即:如果原始签名未更改,
为什么我不能使用 @staticmethod 装饰器使类的 __call__ 方法静态化? class Foo(object): @staticmethod def bar():
我有一个小的 Delphi 10.3.3 应用程序,它有一些文本编辑功能,使用用户输入文本的 TMemo。 我正在尝试包含一些格式选项,如本网站提供的内容: http://qaz.wtf/u/conv
这是我关于使用 Swift 运行的 iOS 应用程序的情况。 我有一个下载按钮,触摸后即可开始下载文件: @IBAction func downloadButtonPressed() { if
我有一个 View ,我需要检测一个属性是否用隐藏输入装饰。 我的属性(property)被定义为: [HiddenInput(DisplayValue = false)] public string
我在我的 Qt 应用程序中绘制线和点,但在 QPainter 中似乎存在缩放错误时遇到了问题。我的线条工作得很好,但点会受到某些缩放转换的影响,尽管笔被设置为“化妆品”。最让我困扰的是似乎只有一个轴(
我在 Eclipse 中遇到 Java 语法着色问题。我正在尝试更改 Eclipse 中 JUST java 修饰符的文本颜色(如公共(public)、 protected 、私有(private))
我在站点上有一些限制区域,我想为其指定 login_required 装饰器。但是我想在主 urls.py 中每次包含一次,而不是包含 urls.py 中的每个单独的 url 所以代替: /priva
这个建议似乎很有意义,因为该方法中没有使用 self,但现在我很好奇: 这是对 CBV 的疏忽吗?用户应该手动装饰每个 @staticmethod? Django 中是否已经有一些代码可以自动使所有
python 3.3:我可以装饰一个函数来忽略所有与命名参数不匹配的位置参数吗? import functools def ignore_star_args(): def wrapper(fu
我是一名优秀的程序员,十分优秀!