[英]Exporting functions from an executable using a def file
There is plenty of information available about how to export functions from a dll (which I've done many times), but I heard that it's also possible to export functions from an executable , so that an external dll can call them. 关于如何从dll导出函数有很多可用的信息(我已经做过很多次了),但是我听说也可以从可执行文件中导出函数,以便外部dll可以调用它们。
Although I've managed to get this working, it seems as though there's some problem with the entry point: 尽管我设法使它起作用,但是入口点似乎存在一些问题:
I'm having trouble finding any documentation on exporting functions from an executable - should I be taking the hint and not doing it? 我在查找有关从可执行文件导出功能的任何文档时遇到麻烦-我应该接受提示而不要这样做吗?
[Context: This was part of an effort to make our process work on both Windows and Linux. [上下文:这是使我们的流程在Windows和Linux上都能正常工作的一部分。 The Linux version was accidentally picking up functions from the executable, rather than ones explicitly exported from an attendant dll (the functions had the same name, but different args). Linux版本意外地从可执行文件中获取功能,而不是从附带的dll中显式导出的功能(这些功能具有相同的名称,但参数不同)。 We decided to try to run with this, and export the functions from the executable on Windows as well.] 我们决定尝试与此一起运行,并从Windows上的可执行文件中导出功能。]
I'm posting this just to summarise my own learning on this, in absence of a better answer: 我发布此内容只是为了总结自己对此的学习,而没有更好的答案:
I hope that this is of some use to anybody else attempting to do something similar. 我希望这对尝试做类似事情的其他人有用。 I will be happy to re-designate a more technical answer as "the solution", should one appear... 如果有人出现,我将很乐意将一个更技术性的答案重新指定为“解决方案”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.