Я создал новый код в программировании на C и создал из него общую библиотеку. Я хочу получить к нему доступ в Pharo 7. Поэтому я помещаю его в / usr / local / lib, / usr / lib и даже в папку, где находится исполняемый файл Pharo. Когда я запускаю код, я всегда получаю «Ошибка: Внешний модуль не найден». Где я должен правильно поставить библиотеку * .so. Я запускаю Pharo 7 в Raspberry Pi 3 Model B + с операционной системой Raspbian Stretch. Вот мой код:
'From Pharo7.0.1 of 25 February 2019 [Build information: Pharo-7.0.1+build.149.sha.890f474a81f116ead0e68c8de77790aef4e9a752 (32 Bit)] on 9 May 2019 at 2:29:46.092395 pm'!
FFILibrary subclass: #AD7091RFFILibrary
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Manifold-AD7091R'!
!AD7091RFFILibrary methodsFor: 'accessing platform' stamp: 'LesterLecong 5/9/2019 14:01'!
unixModuleName
"Kept for backward compatibility.
Users should use unix32* or unix64*"
^ 'AD7091R.so'! !
!AD7091RFFILibrary methodsFor: 'accessing platform' stamp: 'LesterLecong 5/9/2019 11:49'!
macModuleName
^ 'AD7091R.dylib'! !
!AD7091RFFILibrary methodsFor: 'accessing platform' stamp: 'LesterLecong 5/9/2019 11:50'!
win32ModuleName
^ 'AD7091R.dll'! !
!AD7091RFFILibrary methodsFor: 'accessing platform' stamp: 'LesterLecong 5/9/2019 14:01'!
unix32ModuleName
"Kept for backward compatibility.
Users should use unix32* or unix64*"
^ 'AD7091R.so'! !
!AD7091RFFILibrary methodsFor: 'api' stamp: 'LesterLecong 5/9/2019 12:01'!
apiAD7091RDealloc: handle
"int AD7091R_dealloc(AD7091R *p_instance)"
^ self ffiCall: #(int AD7091R_dealloc(AD7091RExternalObject handle))! !
!AD7091RFFILibrary methodsFor: 'api' stamp: 'LesterLecong 5/9/2019 12:13'!
apiAD7091RData: handle pin: pin
"iint AD7091R_data_pin(AD7091R *p_instance,
uint8_t n_data_pin)"
^ self ffiCall: #(int AD7091R_data_pin(AD7091RExternalObject handle, int pin))! !
!AD7091RFFILibrary methodsFor: 'api' stamp: 'LesterLecong 5/9/2019 11:57'!
apiAD7091RAlloc: handle
"int AD7091R_alloc(AD7091R **pp_instance)"
^ self ffiCall: #(int AD7091R_alloc(AD7091RExternalObject *handle))! !
!AD7091RFFILibrary methodsFor: 'api' stamp: 'LesterLecong 5/9/2019 13:12'!
apiAD7091RPins: handle convst: convstPin cs: csPin clk: clkPin data: dataPin
"int AD7091R_pins(AD7091R *p_instance,
uint8_t n_convst_pin,
uint8_t n_cs_pin,
uint8_t n_clk_pin,
uint8_t n_data_pin)"
^self ffiCall: #(int AD7091R_pins(AD7091RExternalObject handle,
int convstPin,
int csPin,
int clkPin,
int dataPin))! !
!AD7091RFFILibrary methodsFor: 'api' stamp: 'LesterLecong 5/9/2019 12:14'!
apiAD7091RBegin: handle
"iint AD7091R_begin(AD7091R *p_instance)"
^ self ffiCall: #(int AD7091R_begin(AD7091RExternalObject handle))! !
!AD7091RFFILibrary methodsFor: 'api' stamp: 'LesterLecong 5/9/2019 12:11'!
apiAD7091RClk: handle pin: pin
"iint AD7091R_clk_pin(AD7091R *p_instance,
uint8_t n_clk_pin)"
^ self ffiCall: #(int AD7091R_clk_pin(AD7091RExternalObject handle, int pin))! !
!AD7091RFFILibrary methodsFor: 'api' stamp: 'LesterLecong 5/9/2019 12:11'!
apiAD7091RConvst: handle pin: pin
"iint AD7091R_convst_pin(AD7091R *p_instance,
uint8_t n_convst_pin)"
^ self ffiCall: #(int AD7091R_convst_pin(AD7091RExternalObject handle, int pin))! !
!AD7091RFFILibrary methodsFor: 'api' stamp: 'LesterLecong 5/9/2019 12:12'!
apiAD7091RCs: handle pin: pin
"iint AD7091R_cs_pin(AD7091R *p_instance,
uint8_t n_cs_pin)"
^ self ffiCall: #(int AD7091R_cs_pin(AD7091RExternalObject handle, int pin))! !
!AD7091RFFILibrary methodsFor: 'api' stamp: 'LesterLecong 5/9/2019 12:16'!
apiAD7091RData: handle
"iint AD7091R_data(AD7091R *p_instance)"
^ self ffiCall: #(int AD7091R_data(AD7091RExternalObject handle))! !
!AD7091RFFILibrary methodsFor: 'api' stamp: 'LesterLecong 5/9/2019 12:16'!
apiAD7091RReset: handle
"iint AD7091R_reset(AD7091R *p_instance)"
^ self ffiCall: #(int AD7091R_reset(AD7091RExternalObject handle))! !