是否有一种简单的方法可以防止Ada名称在创建Ada DLL时受到损坏?防止在Ada DLL中出现重名的名称
这里是我的名.adb代码
with Ada.Text_IO;
package body testDLL is
procedure Print_Call is
begin
Ada.Text_IO.Put_Line("Hello World");
end Print_Call;
function Add_Nums(A,B : in Integer) return Integer is
begin
return A + B;
end Add_Nums;
end testDLL;
我.ads
package testDLL is
procedure Print_Call;
pragma export (dll, Print_Call, "Print_Call");
function Add_Nums(A,B : in Integer) return Integer;
pragma export (dll, Add_Nums, "Add_Nums");
end testDLL;
我的Python
import ctypes
TestDLL = ctypes.WinDLL ("libTestDLL.dll")
Print_Call = getattr(TestDLL, "[email protected]")
Print_Call()
你可以看到,我必须添加 '@ 0' 到我的函数名的末尾,但是当我将相同的代码移动到不同的编译器时,这似乎改变了。这给我造成了一些问题。我需要一个标准的格式化或一种方法来将所有的格式化在一起。
“一个不同的编译器” - 你试过哪些编译器? –