Re: [sqlite] loadable extension doesn't load

2009-08-26 Thread sub sk79
Thanks!

-SK

On Tue, Aug 25, 2009 at 8:09 PM, Roger Binns  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> sub sk79 wrote:
> > I followed the exact instructions (
> > http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions) on SQLite wiki
> for
> > loadable extensions and still have run into this issue.
> > Can someone help me here?
>
> The instructions are how to make a loadable extension in C, but you are
> using C++.
>
> > /home/sk/utils/sqlite/sqlite-3.6.17/half.so: undefined symbol:
> > sqlite3_extension_init
>
> You need to declare sqlite3_extension_init as extern "C".  If you do not
> then the name gets mangled according to normal C++ symbol mangling rules.
>
> Roger
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkqUfT4ACgkQmOOfHg372QS/xQCfVwBrbNLGlX6/cliQiLDY2yrJ
> YvoAoMb7d+pA4KJauvBREa8CWfSkkSwB
> =tyLu
> -END PGP SIGNATURE-
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] loadable extension doesn't load

2009-08-25 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

sub sk79 wrote:
> I followed the exact instructions (
> http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions) on SQLite wiki for
> loadable extensions and still have run into this issue.
> Can someone help me here?

The instructions are how to make a loadable extension in C, but you are
using C++.

> /home/sk/utils/sqlite/sqlite-3.6.17/half.so: undefined symbol:
> sqlite3_extension_init

You need to declare sqlite3_extension_init as extern "C".  If you do not
then the name gets mangled according to normal C++ symbol mangling rules.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqUfT4ACgkQmOOfHg372QS/xQCfVwBrbNLGlX6/cliQiLDY2yrJ
YvoAoMb7d+pA4KJauvBREa8CWfSkkSwB
=tyLu
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] loadable extension doesn't load

2009-08-25 Thread sub sk79
Hi,

I followed the exact instructions (
http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions) on SQLite wiki for
loadable extensions and still have run into this issue.
Can someone help me here?


@HOME-Ubuntu:~/utils/sqlite/sqlite-3.6.17$ gcc -I`pwd` -fPIC -shared
./loadableext.cpp -o half.so
@HOME-Ubuntu:~/utils/sqlite/sqlite-3.6.17$ ls hal*
half.so
@HOME-Ubuntu:~/utils/sqlite/sqlite-3.6.17$ ./sqlite3
SQLite version 3.6.17
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .load half.so
/home/sk/utils/sqlite/sqlite-3.6.17/half.so: undefined symbol:
__gxx_personality_v0


I googled  *__gxx_personality_v0* and one solution was to link with
libstdc++ ,   so I tried that but it still won't work though it failed with
a different error this time. here is the log for that:


@HOME-Ubuntu:~/utils/sqlite/sqlite-3.6.17$ gcc -I`pwd` -fPIC -shared
-lstdc++ ./loadableext.cpp -o half.so
@HOME-Ubuntu:~/utils/sqlite/sqlite-3.6.17$ ./sqlite3
SQLite version 3.6.17
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .load half.so
/home/sk/utils/sqlite/sqlite-3.6.17/half.so: undefined symbol:
sqlite3_extension_init



GCC Version is: gcc (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)

Thanks,
SK
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users