[fpc-pascal] fp universal library ?
Tomas Hajny
XHajT03 at hajny.biz
Tue Feb 11 18:50:48 CET 2014
On Tue, February 11, 2014 16:52, Fred van Stappen wrote:
.
.
> First download the source here :
>
>>> https://sites.google.com/site/fiensprototyping/uoslibtest.tar.gz
>
> Unzip it and in /uoslibtest/src :
>
> 1) Compile uoslib.pas (or uoslib.lpi) => it will create uos.dll in /src.
.
.
It might be better to mention the necessary compiler options (-Mobjfpc
-Sh) or even better include them directly in the respective sources.
In addition, compiling "uoslib.pas" results in "uoslib.dll", whereas you
try to load uos.dll from libconsoleplay.pas.
GDB gives the following backtrace:
0x10002950 in SYSTEM_CPUINCLOCKED$LONGINT () from D:\TEMP\T\src\uoslib.dll
(gdb) bt
#0 0x10002950 in SYSTEM_CPUINCLOCKED$LONGINT () from
D:\TEMP\T\src\uoslib.dll
#1 0x10005195 in fpc_ansistr_incr_ref () from D:\TEMP\T\src\uoslib.dll
#2 0x10001577 in UOS_LOADLIB (
PORTAUDIOFILENAME=0x10001560
'U'#137'ĺ'#131'ě8'#137'Eü'#137'Uř'#137'Mô'#139'Eüčů;',
SNDFILEFILENAME=0x10000000 'MZ'#144, MPG123FILENAME=0x10000000 'MZ'#144,
SOUNDTOUCHFILENAME=0x90ae8
'D:\TEMP\T\src\lib\Windows\32bit\LibPortaudio-32.dll')
at uoslib.pas:43
#3 0x0040d6b1 in UOS_LOADLIBS (UOSLIBFILENAME=0x68028
'D:\TEMP\T\src\uoslib.dll',
PORTAUDIOFILENAME=0x90ae8
'D:\TEMP\T\src\lib\Windows\32bit\LibPortaudio-32.dll',
SNDFILEFILENAME=0x90b28
'D:\TEMP\T\src\lib\Windows\32bit\LibSndFile-32.dll',
MPG123FILENAME=0x0, SOUNDTOUCHFILENAME=0x0) at uoslib_h.pas:347
#4 0x00401670 in CONSOLEPLAY (this=0x98ab8) at libconsoleplay.pas:79
#5 0x00401864 in DORUN (this=0x98ab8) at libconsoleplay.pas:102
#6 0x004211f4 in CUSTAPP_TCUSTOMAPPLICATION_$__RUN ()
#7 0x00401a2f in main () at libconsoleplay.pas:127
It turns out that you missed to specify a matching calling convention for
uos_loadlib (you specified "cdecl" in uoslib_h, but not in uoslib). It
seems to work correctly after adding it at line 41 of uoslib.pas.
Tomas
More information about the fpc-pascal
mailing list