Hello All,

I am trying to compile udf_example.cc or myfunc.cc (copy of udf_example)
with gcc on Solaris 2.8 but facing following errors

[EMAIL PROTECTED]:/usr/local/mysql-4.0.14/sql>gcc -shared
-I/usr/local/mysql-4.0.14/include -o myfunc.so myfunc.cc
In file included from myfunc.cc:122:
/usr/local/mysql-4.0.14/include/my_global.h:70:23: my_config.h: No such file
or directory
In file included from myfunc.cc:122:
/usr/local/mysql-4.0.14/include/my_global.h:456: syntax error before `;'
token
/usr/local/mysql-4.0.14/include/my_global.h:701: syntax error before string 
   constant
/usr/local/mysql-4.0.14/include/my_global.h:781: redeclaration of C++
built-in 
   type `bool'
In file included from myfunc.cc:123:
/usr/local/mysql-4.0.14/include/my_sys.h:593: `func' was not declared in
this 
   scope
/usr/local/mysql-4.0.14/include/my_sys.h:593: type specifier omitted for 
   parameter `RETSIGTYPE()()'
/usr/local/mysql-4.0.14/include/my_sys.h:593: invalid declarator
/usr/local/mysql-4.0.14/include/my_sys.h:644: syntax error before `(' token
/usr/local/mysql-4.0.14/include/my_sys.h:654: syntax error before `(' token
/usr/local/mysql-4.0.14/include/my_sys.h:658: syntax error before `(' token


I tried through make also. See below

[EMAIL PROTECTED]:/usr/local/mysql-4.0.14/sql>/usr/ccs/bin/make udf_example.o
source='udf_example.cc' object='udf_example.o' libtool=no \
depfile='.deps/udf_example.Po' tmpdepfile='.deps/udf_example.TPo' \
depmode=none /bin/bash ../depcomp \
gcc -DMYSQL_SERVER  -DDEFAULT_MYSQL_HOME="\"/usr/local/mysql-4.0.14\""
-DDATADIR="\"/usr/local/mysql-4.0.14/var\""
-DSHAREDIR="\"/usr/local/mysql-4.0.14/share/mysql\""  -DHAVE_CONFIG_H -I.
-I. -I.. -I../innobase/include  -I./../include  -I./../regex  -I.
-I../include -I.      -O3 -DDBUG_OFF -O3 -m64 -fno-omit-frame-pointer
-felide-constructors -fno-exceptions -fno-rtti  -fno-implicit-templates
-fno-exceptions -fno-rtti -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL
-D_FILE_OFFSET_BITS=64 -DHAVE_CURSES_H -I/usr/local/mysql-4.0.14/include
-DHAVE_RWLOCK_T -c -o udf_example.o `test -f udf_example.cc || echo
'./'`udf_example.cc
In file included from udf_example.cc:122:
../include/my_global.h:70:23: my_config.h: No such file or directory
In file included from udf_example.cc:122:
../include/my_global.h:456: syntax error before `;' token
../include/my_global.h:701: syntax error before string constant
../include/my_global.h:781: redeclaration of C++ built-in type `bool'
In file included from udf_example.cc:123:
../include/my_sys.h:593: `func' was not declared in this scope
../include/my_sys.h:593: type specifier omitted for parameter
`RETSIGTYPE()()'
../include/my_sys.h:593: invalid declarator
../include/my_sys.h:644: syntax error before `(' token
../include/my_sys.h:654: syntax error before `(' token
../include/my_sys.h:658: syntax error before `(' token
*** Error code 1
make: Fatal error: Command failed for target `udf_example.o'

Just for testing I commented out the code at error line number and got
udf_example.so or myfunc.so file but when I tried to create function in
mysql, it gave following error

mysql> CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "myfunc.so";
ERROR 1126: Can't open shared library 'myfunc.so' (errno: 0 ld.so.1:
/usr/local/mysql-standard-4.0.14-sun-solaris2.8-sparc-6)

Any tip will be highly appreciable.

Regards,

 <<Sagar, Sanjeev.vcf>> 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to