Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9229339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:32:48+00:00 2026-06-18T05:32:48+00:00

I have built the mySQL C Connector as per the instructions on the mySQL

  • 0

I have built the mySQL C Connector as per the instructions on the mySQL website here, on an ARM computer running Ubuntu 10. I then copied the built headers and libraries, with correct system links, to the paths specified by mysql_config --cflags and mysql_config --libs. So, I have the following output from my_sql_config --cflags --libs:

-I/usr/local/include
-L/usr/local/lib -lmysql -lpthread

and the following directory trees:

/usr/local/include:
atomic        hash.h      my_aes.h        my_base.h      my_dbug.h     my_list.h                my_pthread.h     my_trie.h     mysql.h          mysys               sha2.h             t_ctype.h    waiting_threads.h
base64.h      keycache.h  my_alarm.h      my_bit.h       my_dir.h      my_md5.h         my_stacktrace.h  my_uctype.h   mysql_com.h      mysys_err.h         sql_common.h       thr_alarm.h  wqueue.h
config-win.h  lf.h        my_alloc.h      my_bitmap.h    my_getopt.h   my_net.h         my_sys.h         my_vle.h      mysql_time.h     queues.h            sslopt-case.h      thr_lock.h
decimal.h     m_ctype.h   my_atomic.h     my_charsets.h  my_global.h   my_no_pthread.h  my_time.h        my_xml.h      mysql_version.h  service_versions.h  sslopt-longopts.h  typelib.h
errmsg.h      m_string.h  my_attribute.h  my_config.h    my_libwrap.h  my_nosys.h       my_tree.h        myisampack.h  mysqld_error.h   sha1.h              sslopt-vars.h      violite.h

/usr/local/lib:
drwxr-xr-x  3 root root     4096 Oct 21 10:19 .
drwxr-xr-x 11 root root     4096 Oct 21 09:38 ..
lrwxrwxrwx  1 root root       14 Oct 21 10:12 libmysql.so -> libmysql.so.16
lrwxrwxrwx  1 root root       18 Oct 21 10:11 libmysql.so.16 -> libmysql.so.16.0.0
-rw-r--r--  1 root root  2156350 Oct 21 09:56 libmysql.so.16.0.0
-rw-r--r--  1 root root  2539588 Oct 21 09:56 libmysqlclient.a
lrwxrwxrwx  1 root root       11 Oct 21 10:12 libmysqlclient.so -> libmysql.so
lrwxrwxrwx  1 root root       11 Oct 21 10:13 libmysqlclient_r.so -> libmysql.so

Now, when I try to staticlly compile something, using something like this:

gcc -static -o hello_world $(mysql_config --cflags) hello_world.c $(mysql_config --libs)

I get an error message as follows:

/usr/bin/ld: cannot find -lmysql
collect2: ld returned 1 exit status

Would anyone have any idea as to why my linker cannot find the library when it is in the correct spot and was built on the same platform? Thanks beforehand.

EDIT: When I run the same compile command without the static flag, the complile works OK, however, at runtime I get a error while loading shared libraries: libmysql.so.16: cannot open shared object file: No such file or directory Does anyone know why that may be the case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:32:49+00:00Added an answer on June 18, 2026 at 5:32 am

    You are linking statically against libmysql.a but you do not have such a library available.

    Libraries with the suffix .so are dynamic libraries and libraries with the suffix .a are static libraries.

    If you create a similar symbolic link which you have for the dynamic library, it will probably work:

    ln -s libmysqlclient.a /usr/local/lib/libmysql.a
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have built (locally) a silverlight website. It uses a mysql database (had to
We have built the MySql connector from source and changed the assembly name to
I have downloaded mysql-connector-c-6.0.2. I build it using below commands: cmake -G Unix Makefiles
Why you may ask? Because i have built the app on mysql and need
I am currently using Doctrine's DBAL library for MySQL interfacing and have currently built
Suppose you have a messaging system built in PHP with a MySQL database backend,
I have built a website using flask ( www.csppdb.com ). Sometimes when I log
I have been recently overhauling a website I built for the company I work
I have a website built on Zend Framework. I want to run the site
dear all.. i have a DB which built use Mysql. for this case, i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.