Yep, yep, yep, i get it...
I will (try) to explain the thing...
The error comes mainly because i was focused on SoundTouchDLL.h. (Thanks to
Ludo).
That wrapper is for windows only.
Before to call a DSP-buffer-procedure, you must do :
FHandle := soundtouch_createInstance();
But the result of
Hello.
Thanks to Mister Hinst, i was able to load and run, in Windows, with
dynlib.pas, SoundTouch.dll. Perfect and re-thanks.
Now, i begin a other hard battle : load and run in Linux, libSoundTouch.so.
With the extremely helpful message of Mister Ewald : Try to find the names of
the symbols
On 01/17/2014 03:16 PM, Fred van Stappen wrote:
I run nm and find the name of the procedures ( PS : without nm-Ewald's tip,
you must be a high soothsayer to find it)
For example, a C called procedure : soundtouch_getVersionString() becomes :
I run nm and find the name of the procedures ( PS : without nm-Ewald's tip,
you must be a high soothsayer to find it)
For example, a C called procedure : soundtouch_getVersionString() becomes :
_ZN10soundtouch10SoundTouch16getVersionStringEv() !!!
The
I only have problem with :
_ZN10soundtouch10SoundTouch16getVersionStringEv()...
Ooops, have to read :
I only have problem with :
Pointer(soundtouch_setSampleRate):= GetProcAddress(LibHandle,
Pchar('_ZN10soundtouch10SoundTouch13setSampleRateEj'));
In our previous episode, Fred van Stappen said:
I have only a problem with one procedure:
This c procedure is declared as this :
SOUNDTOUCHDLL_API void __cdecl soundtouch_setSampleRate(HANDLE h, unsigned
int srate);
And i translate it like that :
soundtouch_setSampleRate : procedure(h
Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
In our previous episode, Fred van Stappen said:
I have only a problem with one procedure:
This c procedure is declared as this :
SOUNDTOUCHDLL_API void __cdecl soundtouch_setSampleRate(HANDLE h, unsigned
On 01/17/2014 03:55 PM, Fred van Stappen wrote:
I run nm and find the name of the procedures ( PS : without
nm-Ewald's tip, you must be a high soothsayer to find it)
For example, a C called procedure : soundtouch_getVersionString()
becomes :
On 01/17/2014 03:55 PM, Fred van Stappen wrote:
I run nm and find the name of the procedures ( PS : without
nm-Ewald's tip, you must be a high soothsayer to find it)
For example, a C called procedure : soundtouch_getVersionString()
becomes :
In our previous episode, Fred van Stappen said:
Handle is not defined on Linux. Many libraries emulate some handle type, but
it depends on the vendor if they make handle 32-bit or 64-bit.
Make sure that sizeof(HANDLE) in C++ matches sizeof(THandle) in FPC. Adjust
the type you use at
Writeln(sizeof(THandle)); // for console apps
FHandle := soundtouch_createInstance();
writeln(FHandle);
Writeln(sizeof(FHandle));
Gives that result :
10321232
4
I don't know if the Handle type in the header is defined by the
C++ compiler or by the package itself.
Consult their respective
I don't know if the Handle type in the header is defined by the C++ compiler
or by the package itself. Consult their respective documentation for more
info.
Here declaration of create instance :
// Create a new instance of SoundTouch processor.
SOUNDTOUCHDLL_API HANDLE __cdecl
On 01/17/2014 05:09 PM, Fred van Stappen wrote:
I don't know if the Handle type in the header is defined by the C++
compiler
or by the package itself. Consult their respective documentation for more
info.
Here declaration of create instance :
// Create a new instance of SoundTouch
On 17 Jan 2014, at 17:25, Ludo Brands wrote:
On 01/17/2014 05:09 PM, Fred van Stappen wrote:
I don't know if the Handle type in the header is defined by the C++
compiler
or by the package itself. Consult their respective documentation for more
info.
Here declaration of create instance
That routine is defined in SoundTouchDLL.cpp which is the windows dll
wrapper. Do you have the linux equivalent?
Ludo
PS : For new new arriving : SoundTouchDLL.cpp is part of SoundTouch, a audio
processing library :
http://www.surina.net/soundtouch/download.html
@ Ludo :
In
Yep, there is a brand new wrapper from trunk :
Of course, all the tests i have done are with that new wrapper...
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
On 17 Jan 2014, at 20:40, Fred van Stappen wrote:
Yep, there is a brand new wrapper from trunk :
Ha, then you use/compiled a different version. Since a `extern C` preserves
the symbol name (that is the trick I use to link in a lot of external C++ code:
just put extern C in front of the
Ha, then you use/compiled a different version. Since a `extern C` preserves
the symbol name (that is the trick I use to link in a lot of external C++
code:
just put extern C in front of the symbol). or it could be that I am
completely
missing something here. [for example: is the symbol
That routine is defined in SoundTouchDLL.cpp which is the windows dll
wrapper. Do you have the linux equivalent?
Oops, im full of doubt now...
Do you think the SoundTouchDLL.h wrapper is for Windows only ( and, yes, the
old wrapper uses stdcall (who is windows only)).
And for linux how does
On 17 Jan 2014, at 21:14, Fred van Stappen wrote:
Ha, then you use/compiled a different version. Since a `extern C` preserves
the symbol name (that is the trick I use to link in a lot of external C++
code:
just put extern C in front of the symbol). or it could be that I am
completely
Am 14.01.2014 00:12 schrieb Ewald ew...@yellowcouch.org:
On 13 Jan 2014, at 23:06, Fred van Stappen wrote:
The SoundTouch.dll uses index to call the procedures.
Like that :
[Ordinal/Name Pointer]
[ 0] soundtouch_clear
[ 1] soundtouch_createInstance
[ 2]
In our previous episode, Sven Barth said:
Maybe an overload could be added to load functions by ordinal on Windows
and which simply returns Nil on other platforms.
I thought the index feature originated in win3.x and was mostly considered
deprecated by MS?
Am 14.01.2014 12:04 schrieb Marco van de Voort mar...@stack.nl:
In our previous episode, Sven Barth said:
Maybe an overload could be added to load functions by ordinal on Windows
and which simply returns Nil on other platforms.
I thought the index feature originated in win3.x and was
fred, can you please adjust your quoting to use the standard '' for previous
responses and then add your response below? you do add your response below
but
the quote is the exact of the previous and it is very hard to read only your
responses when the previous is not prefixed by ''...
I identified the problem
Take a look at the function declaration plz:
Function GetProcAddress(Lib : TlibHandle; const ProcName : AnsiString) :
Pointer; // from dynlibs
It internally uses this function:
Function GetProcedureAddress(Lib : TLibHandle; const ProcName : AnsiString) :
Am 14.01.2014 14:02 schrieb Tomas Hajny xhaj...@hajny.biz:
On Tue, January 14, 2014 09:24, Sven Barth wrote:
Am 14.01.2014 00:12 schrieb Ewald ew...@yellowcouch.org:
On 13 Jan 2014, at 23:06, Fred van Stappen wrote:
The SoundTouch.dll uses index to call the procedures.
.
.
No,
Am 14.01.2014 13:21 schrieb Fred van Stappen fi...@hotmail.com:
Now, for the windows version, I don't know what underlying mechanism
dynlibs uses under windows, so I'm afraid I can't really comment on that
platform, except that you could try a similar approach as on linux (use
symbol
names
Am 14.01.2014 09:24 schrieb Sven Barth pascaldra...@googlemail.com:
Maybe an overload could be added to load functions by ordinal on Windows
and which simply returns Nil on other platforms.
I've now added an overload which is implemented for the Windows systems and
returns Nil on other targets.
On Tue, 14 Jan 2014, Sven Barth wrote:
Am 14.01.2014 09:24 schrieb Sven Barth pascaldra...@googlemail.com:
Maybe an overload could be added to load functions by ordinal on Windows and
which simply returns Nil on other platforms.
I've now added an overload which is implemented for the
I identified the problem
Mr Hint : you are magic...
I cannot find words...
1.000 gigas of thanks ( even more...).
Of course you get a big credit in uos project.
Fred
___
fpc-pascal maillist -
@
Hinst, Michael, Tomas, Mark, Lukasz, Ewald, Marco, Sven and Waldo :
MANY, MANY THANKS.
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
Hello.
I have a external dll. In Windows i can access perfectly the procedures with
GetProcAddress() if i use Windows unit.
If i use DynLibs unit, prog crash when i try to load the procedure.
I prefer to use DynLibs unit because i want to use the dll for Linux too (of
course with library.so).
On Mon, 13 Jan 2014, Fred van Stappen wrote:
Hello.
I have a external dll. In Windows i can access perfectly the procedures with
GetProcAddress() if i use Windows unit.
If i use DynLibs unit, prog crash when i try to load the procedure.
I prefer to use DynLibs unit because i want to use the
On Mon, January 13, 2014 11:47, Fred van Stappen wrote:
Hello.
I have a external dll. In Windows i can access perfectly the procedures
with
GetProcAddress() if i use Windows unit.
If i use DynLibs unit, prog crash when i try to load the procedure.
I prefer to use DynLibs unit because i
Date: Mon, 13 Jan 2014 11:58:21 +0100
From: mich...@freepascal.org
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
On Mon, 13 Jan 2014, Fred van Stappen wrote:
Hello.
I have a external dll. In Windows i can
On Mon, 13 Jan 2014, Fred van Stappen wrote:
Here part of NOT working code (if i call soundtouch_createInstance, it
crash)
...
uses
dynlibs ;
...
var
soundtouch_createInstance : function() : THandle; stdcall;
...
procedure InitLib(LibFile : PAnsiChar);
begin
Date: Mon, 13 Jan 2014 12:07:54 +0100
From: xhaj...@hajny.biz
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
On Mon, January 13, 2014 11:47, Fred van Stappen wrote:
Hello.
I have a external dll. In Windows i can
Tomas Hajny wrote:
On Mon, January 13, 2014 11:47, Fred van Stappen wrote:
Hello.
I have a external dll. In Windows i can access perfectly the procedures
with
GetProcAddress() if i use Windows unit.
If i use DynLibs unit, prog crash when i try to load the procedure.
I prefer to use DynLibs
Date: Mon, 13 Jan 2014 12:32:53 +0100
From: mich...@freepascal.org
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
On Mon, 13 Jan 2014, Fred van Stappen wrote:
Here part of NOT working code (if i call
On Mon, 13 Jan 2014, Fred van Stappen wrote:
Date: Mon, 13 Jan 2014 12:32:53 +0100
From: mich...@freepascal.org
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
On Mon, 13 Jan 2014, Fred van Stappen wrote:
Here part
On Mon, 13 Jan 2014, Fred van Stappen wrote:
Date: Mon, 13 Jan 2014 12:32:53 +0100
From: mich...@freepascal.org
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
On Mon, 13 Jan 2014, Fred van Stappen wrote:
Here
On Mon, 13 Jan 2014, Fred van Stappen wrote:
begin
LibHandle:=DynLibs.LoadLibrary(libfilename);
if LibHandle DynLibs.NilHandle then
Pointer(soundtouch_createInstance) :=
DynLibs.GetProcedureAddress(LibHandle, PAnsiChar('soundtouch_createInstance
'));
Remove the
On Mon, 13 Jan 2014, Fred van Stappen wrote:
begin
LibHandle:=DynLibs.LoadLibrary(libfilename);
if LibHandle DynLibs.NilHandle then
Pointer(soundtouch_createInstance):=
DynLibs.GetProcedureAddress(LibHandle,
PAnsiChar('soundtouch_createInstance
'));
On Mon, 13 Jan 2014, Fred van Stappen wrote:
On Mon, 13 Jan 2014, Fred van Stappen wrote:
begin
LibHandle:=DynLibs.LoadLibrary(libfilename);
if LibHandle DynLibs.NilHandle then
Pointer(soundtouch_createInstance) :=
DynLibs.GetProcedureAddress(LibHandle,
Hi,
'scue me if I did not catch something, but
On 13/01/14 12:13, Fred van Stappen wrote:
[...]
procedure InitLib(LibFile : PAnsiChar);
begin
LibHandle:=DynLibs.LoadLibrary(libfilename);
if LibHandle DynLibs.NilHandle then
Pointer(soundtouch_createInstance):=
On Mon, 13 Jan 2014, Fred van Stappen wrote:
On Mon, 13 Jan 2014, Fred van Stappen wrote:
begin
LibHandle:=DynLibs.LoadLibrary(libfilename);
if LibHandle DynLibs.NilHandle then
Pointer(soundtouch_createInstance):=
To: fpc-pascal@lists.freepascal.org
From: el.es...@gmail.com
Date: Mon, 13 Jan 2014 12:52:51 +
Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
Hi,
'scue me if I did not catch something, but
On 13/01/14 12:13, Fred van Stappen wrote
To: fpc-pascal@lists.freepascal.org
From: el.es...@gmail.com
Date: Mon, 13 Jan 2014 12:52:51 +
Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
Hi,
'scue me if I did not catch something, but
On 13/01/14 12:13, Fred van Stappen wrote
On 13/01/14 13:36, Fred van Stappen wrote:
[...]
Hello Lucaz
/// why not just :
@soundtouch_createInstance := DynLibs.GetProcedureAddress(LibHandle,
PAnsiChar('soundtouch_createInstance'));
Get that error :
libSoundTouch.pas(56,5) Error: Can't assign values to an address
This
From: fi...@hotmail.com
To: fpc-pascal@lists.freepascal.org
Date: Mon, 13 Jan 2014 17:33:47 +0100
Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
Hello and many thanks to help.
Here demo to show the problem (i hope).
https://sites.google.com/site
On 13 Jan 2014, at 17:33, Fred van Stappen wrote:
Hello and many thanks to help.
Here demo to show the problem (i hope).
https://sites.google.com/site/fiensprototyping/dynlib_vs_windows.zip
in the dynlibs version, why do you use `PChar(1)` or `PChar(2)` [or ]
instead of the name
From: ew...@yellowcouch.org
Date: Mon, 13 Jan 2014 21:25:27 +0100
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()
On 13 Jan 2014, at 17:33, Fred van Stappen wrote:Hello and many thanks to help.
Here demo to show the problem (i
On 13 Jan 2014, at 23:06, Fred van Stappen wrote:
The SoundTouch.dll uses index to call the procedures.
Like that :
[Ordinal/Name Pointer]
[ 0] soundtouch_clear
[ 1] soundtouch_createInstance
[ 2] soundtouch_destroyInstance
That explains why it works in windows
fred, can you please adjust your quoting to use the standard '' for previous
responses and then add your response below? you do add your response below but
the quote is the exact of the previous and it is very hard to read only your
responses when the previous is not prefixed by ''... thanks!
54 matches
Mail list logo