Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-23

Undefined references while trying to compile primitive program with mysql_init

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • Ubuntu 12.04 Precise x86_64 gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

    Description

      I am trying to compile the "hello world"-kind of program quoted below, but getting a bunch of "undefined reference" errors. With MySQL Connector/C 6.0.2 built on the same machine it compiles all right.

      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(my_thr_init.c.o): In function `my_thread_init':
      /data/bzr/mariadb-native-client/libmariadb/my_thr_init.c:130: undefined reference to `pthread_getspecific'
      /data/bzr/mariadb-native-client/libmariadb/my_thr_init.c:143: undefined reference to `pthread_setspecific'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(my_thr_init.c.o): In function `my_thread_global_init':
      /data/bzr/mariadb-native-client/libmariadb/my_thr_init.c:57: undefined reference to `pthread_key_create'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(my_thr_init.c.o): In function `_my_thread_var':
      /data/bzr/mariadb-native-client/libmariadb/my_thr_init.c:191: undefined reference to `pthread_getspecific'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(my_thr_init.c.o): In function `my_thread_end':
      /data/bzr/mariadb-native-client/libmariadb/my_thr_init.c:185: undefined reference to `pthread_setspecific'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(my_stmt_codec.c.o): In function `convert_from_float':
      /data/bzr/mariadb-native-client/libmariadb/my_stmt_codec.c:498: undefined reference to `floor'
      /data/bzr/mariadb-native-client/libmariadb/my_stmt_codec.c:498: undefined reference to `floor'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(client_plugin.c.o): In function `add_plugin':
      /data/bzr/mariadb-native-client/libmariadb/client_plugin.c:190: undefined reference to `dlclose'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(client_plugin.c.o): In function `mysql_client_plugin_deinit':
      /data/bzr/mariadb-native-client/libmariadb/client_plugin.c:295: undefined reference to `dlclose'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(client_plugin.c.o): In function `mysql_load_plugin_v':
      /data/bzr/mariadb-native-client/libmariadb/client_plugin.c:367: undefined reference to `dlopen'
      /data/bzr/mariadb-native-client/libmariadb/client_plugin.c:382: undefined reference to `dlsym'
      /data/bzr/mariadb-native-client/libmariadb/client_plugin.c:385: undefined reference to `dlclose'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(my_compress.c.o): In function `my_compress_alloc':
      /data/bzr/mariadb-native-client/libmariadb/my_compress.c:53: undefined reference to `compress'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(my_compress.c.o): In function `my_uncompress':
      /data/bzr/mariadb-native-client/libmariadb/my_compress.c:77: undefined reference to `uncompress'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(password.c.o): In function `scramble_323':
      /data/bzr/mariadb-native-client/libmariadb/password.c:197: undefined reference to `floor'
      /data/bzr/mariadb-native-client/libmariadb/password.c:198: undefined reference to `floor'
      /data/bzr/mariadb-native-client/libmariadb/libmariadbclient.a(password.c.o): In function `check_scramble':
      /data/bzr/mariadb-native-client/libmariadb/password.c:222: undefined reference to `floor'
      /data/bzr/mariadb-native-client/libmariadb/password.c:226: undefined reference to `floor'
      collect2: ld returned 1 exit status

      Test code:

      #include <my_global.h>
      #include <mysql.h>
       
      int main(int argc, char **argv)
      {
        MYSQL *conn;
        conn = mysql_init(NULL);
      }

      Command line:

      gcc conc23.c -I/data/bzr/mariadb-native-client/include -L/data/bzr/mariadb-native-client/libmariadb -lmariadbclient -o conc23

      ldd /data/bzr/mariadb-native-client/libmariadb/libmariadb.so
      	linux-vdso.so.1 =>  (0x00007fffd23ff000)
      	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2c4ea2f000)
      	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2c4e812000)
      	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2c4e60d000)
      	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2c4e311000)
      	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2c4df52000)
      	/lib64/ld-linux-x86-64.so.2 (0x00007f2c4ee8d000)

      bzr version-info
      revision-id: holzboote@googlemail.com-20130326103154-1p9jscsjhtumlqfr
      revno: 50
      branch-nick: mariadb-native-client

      Attachments

        Issue Links

          Activity

            People

              georg Georg Richter
              elenst Elena Stepanova
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.