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

undefined reference to `mysql_init'

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Not a Bug
    • 3.0.4
    • N/A
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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