List:MySQL++« Previous MessageNext Message »
From:Chris Frey Date:April 23 2005 8:02pm
Subject:Re: Not able to connect to Mysql now
View as plain text  
If you look at the error messages, it says it is trying to link 'main',
and that it is looking for thread specific functions that 'libmysqlpp.so'
is relying on.

This means:
	- it is trying to create the final binary of your program.
		This is impossible since you are only compiling util.cpp,
		which has no main() in it.  What you are probably trying to
		do is just compile util.cpp to util.o (object file) so you
		can then later link a bunch of .o files together into your
		final program.  Look at the gcc man page to find the proper
		command line switch to compile only, and not link yet.

		Take a look inside util.cpp, and note there is no main().

	- it is trying to find thread stuff, so that means you have compiled
		mysql++ with thread support turned on.  If this is not what
		you expected, recompile and reinstall mysql++ with the proper
		options to the configure script.

		If it is what you expect, then you need to add the appropriate
		thread library of your system as another -l option in the list.
		You currently have -lmysqlpp and -lmysqlclient, you'll need
		one for threading.

- Chris


On Sat, Apr 23, 2005 at 11:18:08AM -0700, chandra shekar wrote:
> Hi 
> 
> I tried using the -L switch but it is giving error as
> shown below.
> 
>  g++ -I/usr/local/include -I/usr/local/mysql/include
> -L/usr/local/lib -o util util.cpp -lmysqlpp
> -lmysqlclient
> 
> 
> ERRORS:
> /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crt1.o(.text+0x18):
> In function `_start':
> ../sysdeps/i386/elf/start.S:77: undefined reference to
> `main'
> /usr/local/lib/libmysqlpp.so: undefined reference to
> `pthread_getspecific'
> /usr/local/lib/libmysqlpp.so: undefined reference to
> `pthread_key_delete'
> /usr/local/lib/libmysqlpp.so: undefined reference to
> `pthread_mutexattr_destroy'
> /usr/local/lib/libmysqlpp.so: undefined reference to
> `pthread_mutexattr_setkind_np'
> /usr/local/lib/libmysqlpp.so: undefined reference to
> `pthread_key_create'
> /usr/local/lib/libmysqlpp.so: undefined reference to
> `pthread_mutexattr_init'
> /usr/local/lib/libmysqlpp.so: undefined reference to
> `pthread_setspecific'
> collect2: ld returned 1 exit status
> 
> I also used the option -L/usr/local/mysql/lib but for
> the same error.
> 
> I have set LD_LIBRARY_PATH to /usr/local/lib in
> .bash_profile.
> I have updated /etc/ld.so.conf with above paths and
> ran ldconfig.
> 
> The .o files under /examples are working fine, but I
> am not able to compile seperatly. 
> I reconfigured mysql++ and repeated above steps but
> for no use. 
> 
> Please help..!!!
> 
> Thanx
> shekar.
> 
> 
> --- Warren Young <mysqlpp@stripped> wrote:
> 
> > chandra shekar wrote:
> > 
> > > usr/bin/ld: cannot find -lmysqlclient
> > 
> > That's the MySQL C API library.  It is either not
> > installed in a 
> > directory that ld can find on its own, or it is not
> > installed at all. 
> > If the former, use the -L compiler switch to tell it
> > where the library 
> > is at.
> > 
> > -- 
> > MySQL++ Mailing List
> > For list archives: http://lists.mysql.com/plusplus
> > To unsubscribe:   
> >
> http://lists.mysql.com/plusplus?unsub=1
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> -- 
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:    http://lists.mysql.com/plusplus?unsub=1
Thread
Re: Not able to install the rpm - not able to connect to Mysql nowchandra shekar18 Apr
  • Re: Not able to install the rpm - not able to connect to Mysql nowWarren Young18 Apr
    • Re: Not able to connect to Mysql nowchandra shekar21 Apr
      • Re: Not able to connect to Mysql nowWarren Young21 Apr
        • Re: Not able to connect to Mysql nowchandra shekar23 Apr
          • Re: Not able to connect to Mysql nowChris Frey23 Apr
            • Re: Not able to connect to Mysql nowWarren Young25 Apr
            • Re: Not able to connect to Mysql nowchandra shekar25 Apr