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

undefined reference to `mysql_init'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Not a Bug
    • Affects Version/s: 3.0.4
    • Fix Version/s: N/A
    • Environment:
      ubuntu linux

      Description

      how to compile and link the connector.
      i have compiled and sudo make install successfully.

      I get a reference error
      SOURCE: main.cpp

      #include <mysql.h>
      #include <stdio.h>
      #include <string.h>
      #include <stdlib.h>

      int main(int argc, char *argv[])

      { MYSQL *mysql; const char *query; MYSQL_RES *result; mysql= mysql_init(NULL); }

      COMPILE:
      gcc main.cpp -o main -I/usr/local/include/mariadb
      -L/usr/local/lib/mariadb/libmariadb -L/usr/local/lib/mariadb/libmariadbclient

      /tmp/cczVzenH.o: In function `main':
      main.cpp.text+0x15): undefined reference to `mysql_init'
      collect2: error: ld returned 1 exit status

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              georg Georg Richter
              Reporter:
              yoosamui Juan Gonzalez
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: