我创建了一个具有导出和约定方面的通用函数。然后我实例化了这个函数,但它以“r”后缀出现在我的库中。为什么会发生这种情况,我该如何解决?
例如:
generic
I : int;
function Test_Generic return int
with Export => True, Convention => C;
function Test_Generic return int is
begin
return I;
end;
function Test is new Test_Generic (I => 5);
-- In library this function has name testr
最佳答案
一个更简单的答案是将所有方面移动到通用实例,但也添加一个 External_Name 方面:
function Test is new Test_Generic (I => 5)
with Export, Convention => C, External_Name => "test";
不明白这里为什么要External_Name,Export不行。
关于generics - 如何将实例化的泛型函数导出到 C,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66943711/