gpt4 book ai didi

c - 如何在 CAPL 中包含 .dll 文件?

转载 作者:行者123 更新时间:2023-11-30 14:48:02 27 4
gpt4 key购买 nike

我尝试使用以下命令将 .dll 文件包含在我的 CAPL 代码中,但收到以下警告:

Warning 2102 at (6,20): Could not open C:\Users\Desktop\OpenSSL_MacGen\OpenSSL_MacGen\Debug\OpenSSL_MacGen.dll, The specified module could not be found.

#pragma library ("OpenSSL_MacGen\OpenSSL_MacGen\Debug\OpenSSL_MacGen.dll")

最佳答案

摘自 CANoe 帮助:

In CAPL programs you can call functions which you have implemented in your own Windows DLL. In doing so, the function from the DLL are exported through a function table.

The CAPL DLL interface supports callback functions starting with CANoe version 5.0.

Whenever functions of a DLL are called in the real-time area (i.e. in Simulation Setup of CANoe), they run in a high-priority thread. This can affect measurement.

In order for the CAPL compiler and CAPL browser to recognize the DLL, you must link it to the CAPL program. To do this, proceed as follows:

Enter the DLL in the Options dialog in CANoe. In this case, the DLL will be available to all CAPL programs. You can enter the DLL in the includes section of a CAPL program using the #pragma library command. In this case, it will only be available to this program.

最简单的方法是使用安装了 CANoe 的 PC 上提供的模板。查看:C:\Users\Public\Documents\Vector\CANoe\9.0 (x64)\CANoe Sample Configurations\Programming\CAPLdll(或类似的内容,具体取决于您的 CANoe 版本)

关于c - 如何在 CAPL 中包含 .dll 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50777374/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com