logo       


Re: Not able to connect to Mysql now: msg#00080

Subject: Re: Not able to connect to Mysql now
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@xxxxxxxxxxx> 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=mailtoshekar@xxxxxxxxx
> > 
> > 
> 
> 
> __________________________________________________
> 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=cdfrey@xxxxxxxxxxxx

-- 
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:    
http://lists.mysql.com/plusplus?unsub=gcdmc-plusplus@xxxxxxxxxxx




Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe