Subject | Re: [firebird-support] UDF memory allocation for result string in Linux |
---|---|
Author | Tomasz Tyrakowski |
Post date | 2012-04-17T07:20:26Z |
On 2012-04-17 08:01, ma_golyo wrote:
/opt/firebird/include) or explicitly declare void*
ib_util_malloc(size_t) at the beginning of the source module, use
ib_util_malloc instead of C's malloc, and link against ib_util
(libib_util.so is by default located in /opt/firebird/lib).
Your compilation command line should look like this:
gcc -O -fPIC -shared -I/opt/firebird/include -L/opt/firebird/lib \
-oUDF3s.so UDF3s.c -lib_util -lstdc++ -lm -lc
(I'm not sure whether libstdc++ is necessary, sometimes it is).
regards
Tomasz
--
__--==============================--__
__--== Tomasz Tyrakowski ==--__
__--== SOL-SYSTEM ==--__
__--== http://www.sol-system.pl ==--__
__--==============================--__
> I use ib_util_malloc in my Win version, no problem there. What should I use in Linux version? Currently memory allocated with malloc.Include ib_util.h in your UDF's source (it's located by default in
/opt/firebird/include) or explicitly declare void*
ib_util_malloc(size_t) at the beginning of the source module, use
ib_util_malloc instead of C's malloc, and link against ib_util
(libib_util.so is by default located in /opt/firebird/lib).
Your compilation command line should look like this:
gcc -O -fPIC -shared -I/opt/firebird/include -L/opt/firebird/lib \
-oUDF3s.so UDF3s.c -lib_util -lstdc++ -lm -lc
(I'm not sure whether libstdc++ is necessary, sometimes it is).
regards
Tomasz
--
__--==============================--__
__--== Tomasz Tyrakowski ==--__
__--== SOL-SYSTEM ==--__
__--== http://www.sol-system.pl ==--__
__--==============================--__