To reply to my own problem, my confusion stems from the change from
my_thread_init() in MySQL version 3.x to mysql_thread_init() in
version 4.x. Fair enough, but my_thread_init is still supported
in version 4.x. So, should developers who wish to write the most
portable code use my_thread_init(), or do a test (say on MYSQL_VERSION_ID)
to determine whether to use my_thread_init() or use mysql_thread_init()?
Thanks,
rob
On Mon, Jul 29, 2002 at 02:11:15PM -0400, Robert Beverly wrote:
>
> I am porting a multi-threaded MySQL client application that is currently
> working fine on my development Solaris box to multiple platforms.
> For some reason that I cannot figure out, my autoconf script is
> failing on Linux looking for the mysql_thread_init() function in
> libmysqlclient_r. From the config.log, I see that the simple test
> program is:
>
> int main () {
> mysql_thread_init();
> return 0;
> }
>
> To determine why it was failing, I tried compiling this simple program
> on my Solaris 2.7 machine, linking with -lpthread and -lmysqlclient_r:
> gcc abc.c -o abc -lpthread -lmysqlclient_r
>
> It compiles fine on Solaris 2.7. On my Red Hat 7.2 (kernel 2.4.18)
> machine, I have compiled and installed MySQL 3.23.51 with the
> "--enable-thread-safe-client" configure option. When I try to
> compile the exact same program, I get a linker error:
>
> /tmp/ccEsSfhd.o: In function `main':
> /tmp/ccEsSfhd.o(.text+0x7): undefined reference to `mysql_thread_init'
>
> The libmysqlclient_r library (libmysqlclient_r.so.10.0.0) does exist
> and is obviously being found (otherwise I would get a library not found
> error when specifying -lmysqlclient_r).
>
> So, I cannot determine why on Linux, after I have built the thread-safe
> library, the linker still cannot find mysql_thread_init. Any suggestions
> very welcomed. Thanks,
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php