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 973491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:17:14+00:00 2026-05-16T03:17:14+00:00

#include <my_global.h> #include <mysql.h> int main(int argc, char **argv) { printf(MySQL client version: %s\n,

  • 0
#include <my_global.h>
#include <mysql.h>

int main(int argc, char **argv)
{
  printf("MySQL client version: %s\n", mysql_get_client_info());
}

~$ gcc -o mysql-test MySQL-Test.c

im trying to execute this test program from terminal but get the following error message:

/tmp/cceEmI0I.o: In function main': MySQL-Test.c:(.text+0xa): undefined reference tomysql_get_client_info’

what is wrong? my system is ubuntu

  • 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-05-16T03:17:15+00:00Added an answer on May 16, 2026 at 3:17 am

    MySQL comes with a special script called mysql_config. It provides you with useful information for compiling your MySQL client and connecting it to MySQL database server.

    Pass --libs option – Libraries and options required to link with the MySQL client library.

    $ mysql_config --libs
    

    Typical Output:

    -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib64 -lssl -lcrypto
    

    Now you can add this to your compile/link line:

    gcc -o mysql-test MySQL-Test.c $(mysql_config --libs)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

// File test.cpp #include <my_global.h> #include <algorithm> int main() { return 0; } Compiled
Here is my code: #include <stdio.h> int main(void) { FILE *fp; unsigned int i;
I am trying to setup a mysql database, but I am getting this error
I've been trying to use MySQL and C++ together but can't seem to get
i want to connect C to mysql using the following code: #include <C:\Program Files\MySQL\MySQL
I'm trying to create a C program that can communicate with MySQL database via
my sample code is here include 'simple_html_dom.php'; function get_all_links($url){ global $host; $html = new
In my CMS I've added this code <div><?php include(my_contact_form.php) ?></div> which updates to a
I recently added CKEditor to my app and I would like to include my
I have extended the ASP.NET MVC Html Helper to include my own ValidationImage that

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.