dbTalk Databases Forums  

Re: How attach external library to ASA

sybase.public.sqlanywhere.linux sybase.public.sqlanywhere.linux


Discuss Re: How attach external library to ASA in the sybase.public.sqlanywhere.linux forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ljb
 
Posts: n/a

Default Re: How attach external library to ASA - 12-26-2008 , 10:13 AM






Ilya wrote:
Quote:
I need to connect library with external functions to the
ASA. The library is created. But at run function from SQL I
get this error: "Could not load dynamic library
'/opt/lib/libcrc32.so'". What do I do not so?
I do:
1) gcc -DUNIX -Wall -fPIC -c *.cpp
2) gcc -shared -Wl,-soname,libcrc32.so.1 -o libcrc32.so.1.0
*.o
3) mv libcrc32.so.1.0 /opt/lib
4) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so
5) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so.1
On SQL:
1) create function DBA.xp_crc32(in p long varchar) returns
unsigned integer external name
'xp_crc32@/opt/lib/libcrc32.so'
2) select DBA.xp_crc32('TestString')

P.S.Listing library attached. ASA 9.0.2. Linux
2.6.18-92.el5.asp121 x86_64.
It's failing to load the library with your function because of an
unresolved reference to an internally-used C++ symbol. (Not very helpful
error message, is it? Takes some work to figure out.) If you can write in C
and not C++ it should work. (Source file needs to be named *.c not *.cpp,
even though using gcc.) If you cannot use plain C, you will have to try to
figure out how to link in the C++ support library it is looking for.
Hope this helps.


Reply With Quote
  #2  
Old   
ljb
 
Posts: n/a

Default Re: How attach external library to ASA - 12-26-2008 , 10:13 AM






Ilya wrote:
Quote:
I need to connect library with external functions to the
ASA. The library is created. But at run function from SQL I
get this error: "Could not load dynamic library
'/opt/lib/libcrc32.so'". What do I do not so?
I do:
1) gcc -DUNIX -Wall -fPIC -c *.cpp
2) gcc -shared -Wl,-soname,libcrc32.so.1 -o libcrc32.so.1.0
*.o
3) mv libcrc32.so.1.0 /opt/lib
4) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so
5) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so.1
On SQL:
1) create function DBA.xp_crc32(in p long varchar) returns
unsigned integer external name
'xp_crc32@/opt/lib/libcrc32.so'
2) select DBA.xp_crc32('TestString')

P.S.Listing library attached. ASA 9.0.2. Linux
2.6.18-92.el5.asp121 x86_64.
It's failing to load the library with your function because of an
unresolved reference to an internally-used C++ symbol. (Not very helpful
error message, is it? Takes some work to figure out.) If you can write in C
and not C++ it should work. (Source file needs to be named *.c not *.cpp,
even though using gcc.) If you cannot use plain C, you will have to try to
figure out how to link in the C++ support library it is looking for.
Hope this helps.


Reply With Quote
  #3  
Old   
ljb
 
Posts: n/a

Default Re: How attach external library to ASA - 12-26-2008 , 10:13 AM



Ilya wrote:
Quote:
I need to connect library with external functions to the
ASA. The library is created. But at run function from SQL I
get this error: "Could not load dynamic library
'/opt/lib/libcrc32.so'". What do I do not so?
I do:
1) gcc -DUNIX -Wall -fPIC -c *.cpp
2) gcc -shared -Wl,-soname,libcrc32.so.1 -o libcrc32.so.1.0
*.o
3) mv libcrc32.so.1.0 /opt/lib
4) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so
5) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so.1
On SQL:
1) create function DBA.xp_crc32(in p long varchar) returns
unsigned integer external name
'xp_crc32@/opt/lib/libcrc32.so'
2) select DBA.xp_crc32('TestString')

P.S.Listing library attached. ASA 9.0.2. Linux
2.6.18-92.el5.asp121 x86_64.
It's failing to load the library with your function because of an
unresolved reference to an internally-used C++ symbol. (Not very helpful
error message, is it? Takes some work to figure out.) If you can write in C
and not C++ it should work. (Source file needs to be named *.c not *.cpp,
even though using gcc.) If you cannot use plain C, you will have to try to
figure out how to link in the C++ support library it is looking for.
Hope this helps.


Reply With Quote
  #4  
Old   
ljb
 
Posts: n/a

Default Re: How attach external library to ASA - 12-26-2008 , 10:13 AM



Ilya wrote:
Quote:
I need to connect library with external functions to the
ASA. The library is created. But at run function from SQL I
get this error: "Could not load dynamic library
'/opt/lib/libcrc32.so'". What do I do not so?
I do:
1) gcc -DUNIX -Wall -fPIC -c *.cpp
2) gcc -shared -Wl,-soname,libcrc32.so.1 -o libcrc32.so.1.0
*.o
3) mv libcrc32.so.1.0 /opt/lib
4) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so
5) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so.1
On SQL:
1) create function DBA.xp_crc32(in p long varchar) returns
unsigned integer external name
'xp_crc32@/opt/lib/libcrc32.so'
2) select DBA.xp_crc32('TestString')

P.S.Listing library attached. ASA 9.0.2. Linux
2.6.18-92.el5.asp121 x86_64.
It's failing to load the library with your function because of an
unresolved reference to an internally-used C++ symbol. (Not very helpful
error message, is it? Takes some work to figure out.) If you can write in C
and not C++ it should work. (Source file needs to be named *.c not *.cpp,
even though using gcc.) If you cannot use plain C, you will have to try to
figure out how to link in the C++ support library it is looking for.
Hope this helps.


Reply With Quote
  #5  
Old   
ljb
 
Posts: n/a

Default Re: How attach external library to ASA - 12-26-2008 , 10:13 AM



Ilya wrote:
Quote:
I need to connect library with external functions to the
ASA. The library is created. But at run function from SQL I
get this error: "Could not load dynamic library
'/opt/lib/libcrc32.so'". What do I do not so?
I do:
1) gcc -DUNIX -Wall -fPIC -c *.cpp
2) gcc -shared -Wl,-soname,libcrc32.so.1 -o libcrc32.so.1.0
*.o
3) mv libcrc32.so.1.0 /opt/lib
4) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so
5) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so.1
On SQL:
1) create function DBA.xp_crc32(in p long varchar) returns
unsigned integer external name
'xp_crc32@/opt/lib/libcrc32.so'
2) select DBA.xp_crc32('TestString')

P.S.Listing library attached. ASA 9.0.2. Linux
2.6.18-92.el5.asp121 x86_64.
It's failing to load the library with your function because of an
unresolved reference to an internally-used C++ symbol. (Not very helpful
error message, is it? Takes some work to figure out.) If you can write in C
and not C++ it should work. (Source file needs to be named *.c not *.cpp,
even though using gcc.) If you cannot use plain C, you will have to try to
figure out how to link in the C++ support library it is looking for.
Hope this helps.


Reply With Quote
  #6  
Old   
ljb
 
Posts: n/a

Default Re: How attach external library to ASA - 12-26-2008 , 10:13 AM



Ilya wrote:
Quote:
I need to connect library with external functions to the
ASA. The library is created. But at run function from SQL I
get this error: "Could not load dynamic library
'/opt/lib/libcrc32.so'". What do I do not so?
I do:
1) gcc -DUNIX -Wall -fPIC -c *.cpp
2) gcc -shared -Wl,-soname,libcrc32.so.1 -o libcrc32.so.1.0
*.o
3) mv libcrc32.so.1.0 /opt/lib
4) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so
5) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so.1
On SQL:
1) create function DBA.xp_crc32(in p long varchar) returns
unsigned integer external name
'xp_crc32@/opt/lib/libcrc32.so'
2) select DBA.xp_crc32('TestString')

P.S.Listing library attached. ASA 9.0.2. Linux
2.6.18-92.el5.asp121 x86_64.
It's failing to load the library with your function because of an
unresolved reference to an internally-used C++ symbol. (Not very helpful
error message, is it? Takes some work to figure out.) If you can write in C
and not C++ it should work. (Source file needs to be named *.c not *.cpp,
even though using gcc.) If you cannot use plain C, you will have to try to
figure out how to link in the C++ support library it is looking for.
Hope this helps.


Reply With Quote
  #7  
Old   
ljb
 
Posts: n/a

Default Re: How attach external library to ASA - 12-26-2008 , 10:13 AM



Ilya wrote:
Quote:
I need to connect library with external functions to the
ASA. The library is created. But at run function from SQL I
get this error: "Could not load dynamic library
'/opt/lib/libcrc32.so'". What do I do not so?
I do:
1) gcc -DUNIX -Wall -fPIC -c *.cpp
2) gcc -shared -Wl,-soname,libcrc32.so.1 -o libcrc32.so.1.0
*.o
3) mv libcrc32.so.1.0 /opt/lib
4) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so
5) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so.1
On SQL:
1) create function DBA.xp_crc32(in p long varchar) returns
unsigned integer external name
'xp_crc32@/opt/lib/libcrc32.so'
2) select DBA.xp_crc32('TestString')

P.S.Listing library attached. ASA 9.0.2. Linux
2.6.18-92.el5.asp121 x86_64.
It's failing to load the library with your function because of an
unresolved reference to an internally-used C++ symbol. (Not very helpful
error message, is it? Takes some work to figure out.) If you can write in C
and not C++ it should work. (Source file needs to be named *.c not *.cpp,
even though using gcc.) If you cannot use plain C, you will have to try to
figure out how to link in the C++ support library it is looking for.
Hope this helps.


Reply With Quote
  #8  
Old   
ljb
 
Posts: n/a

Default Re: How attach external library to ASA - 12-26-2008 , 10:13 AM



Ilya wrote:
Quote:
I need to connect library with external functions to the
ASA. The library is created. But at run function from SQL I
get this error: "Could not load dynamic library
'/opt/lib/libcrc32.so'". What do I do not so?
I do:
1) gcc -DUNIX -Wall -fPIC -c *.cpp
2) gcc -shared -Wl,-soname,libcrc32.so.1 -o libcrc32.so.1.0
*.o
3) mv libcrc32.so.1.0 /opt/lib
4) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so
5) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so.1
On SQL:
1) create function DBA.xp_crc32(in p long varchar) returns
unsigned integer external name
'xp_crc32@/opt/lib/libcrc32.so'
2) select DBA.xp_crc32('TestString')

P.S.Listing library attached. ASA 9.0.2. Linux
2.6.18-92.el5.asp121 x86_64.
It's failing to load the library with your function because of an
unresolved reference to an internally-used C++ symbol. (Not very helpful
error message, is it? Takes some work to figure out.) If you can write in C
and not C++ it should work. (Source file needs to be named *.c not *.cpp,
even though using gcc.) If you cannot use plain C, you will have to try to
figure out how to link in the C++ support library it is looking for.
Hope this helps.


Reply With Quote
  #9  
Old   
ljb
 
Posts: n/a

Default Re: How attach external library to ASA - 12-26-2008 , 10:13 AM



Ilya wrote:
Quote:
I need to connect library with external functions to the
ASA. The library is created. But at run function from SQL I
get this error: "Could not load dynamic library
'/opt/lib/libcrc32.so'". What do I do not so?
I do:
1) gcc -DUNIX -Wall -fPIC -c *.cpp
2) gcc -shared -Wl,-soname,libcrc32.so.1 -o libcrc32.so.1.0
*.o
3) mv libcrc32.so.1.0 /opt/lib
4) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so
5) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so.1
On SQL:
1) create function DBA.xp_crc32(in p long varchar) returns
unsigned integer external name
'xp_crc32@/opt/lib/libcrc32.so'
2) select DBA.xp_crc32('TestString')

P.S.Listing library attached. ASA 9.0.2. Linux
2.6.18-92.el5.asp121 x86_64.
It's failing to load the library with your function because of an
unresolved reference to an internally-used C++ symbol. (Not very helpful
error message, is it? Takes some work to figure out.) If you can write in C
and not C++ it should work. (Source file needs to be named *.c not *.cpp,
even though using gcc.) If you cannot use plain C, you will have to try to
figure out how to link in the C++ support library it is looking for.
Hope this helps.


Reply With Quote
  #10  
Old   
ljb
 
Posts: n/a

Default Re: How attach external library to ASA - 12-26-2008 , 10:13 AM



Ilya wrote:
Quote:
I need to connect library with external functions to the
ASA. The library is created. But at run function from SQL I
get this error: "Could not load dynamic library
'/opt/lib/libcrc32.so'". What do I do not so?
I do:
1) gcc -DUNIX -Wall -fPIC -c *.cpp
2) gcc -shared -Wl,-soname,libcrc32.so.1 -o libcrc32.so.1.0
*.o
3) mv libcrc32.so.1.0 /opt/lib
4) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so
5) ln -sf /opt/lib/libcrc32.so.1.0 /opt/lib/libcrc32.so.1
On SQL:
1) create function DBA.xp_crc32(in p long varchar) returns
unsigned integer external name
'xp_crc32@/opt/lib/libcrc32.so'
2) select DBA.xp_crc32('TestString')

P.S.Listing library attached. ASA 9.0.2. Linux
2.6.18-92.el5.asp121 x86_64.
It's failing to load the library with your function because of an
unresolved reference to an internally-used C++ symbol. (Not very helpful
error message, is it? Takes some work to figure out.) If you can write in C
and not C++ it should work. (Source file needs to be named *.c not *.cpp,
even though using gcc.) If you cannot use plain C, you will have to try to
figure out how to link in the C++ support library it is looking for.
Hope this helps.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.