我使用Delphi 10.1 Berlin。我已经创建了应用程序,我使用这个库启动(C上的库)
我第一次启动它时发现了libhid.dylib未找到的错误。我已将其添加到rpath并解决了错误。
但是现在当我打开应用程序时,当我尝试从库中调用方法时,我接下来:
Process: Project2 [8538]
Path: /Users/USER/*/Project2.app/Contents/MacOS/Project2
Identifier: Project2
Version: 1.0.0 (1.0.0)
Code Type: X86 (Native)
Parent Process: ??? [1]
Responsible: Project2 [8538]
User ID: 506
Date/Time: 2018-01-23 14:03:14.976 +0200
OS Version: Mac OS X 10.12.6 (16G29)
Report Version: 12
Anonymous UUID: 4E81F6AB-1EEF-F9C1-160C-A01D8944D786
Sleep/Wake UUID: DB3C055B-BE55-40B8-88A5-6D5530E284AB .
Time Awake Since Boot: 140000 seconds
Time Since Wake: 14000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: DYLD, [0x4] Symbol missing
Dyld Error Message:
Symbol not found: _DeleteAll
Referenced from: /Users/USER/*/Project2.app/Contents/MacOS/Project2
Expected in: /usr/local/lib/libhidlib.dylib
这是我链接库的代码。
unit Unit1;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
FMX.Controls.Presentation, FMX.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
{$IFDEF MSWINDOWS}
function DeleteAll():shortstring; stdcall; external 'Project1.dll' delayed;
{$ENDIF}
{$IFDEF MACOS}
function _DeleteAll():shortstring; cdecl; external 'libhidlib.dylib' ;
{$ENDIF}
var
Form1: TForm1;
implementation
答案 0 :(得分:0)
所以,经过几周搜索我发现的信息,发布后新的OS X版程序员改变了OS X的文件结构(10.9 100%)
德尔福怎么样?项目可能连接到库但不能使用它的方法。