gcc wont compile and run MySQL C libraries

后端 未结 7 580
不知归路
不知归路 2021-02-03 14:20
#include 
#include 

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

7条回答
  •  清酒与你
    2021-02-03 14:43

    For uses of Netbeans on Linux

    Open you make file (MakeFile) and add the following lines

    # These are the flags that gcc requires in order to link correctly against our installed 
    # client packages
    MYSQL_LIBS := $(shell mysql_config --libs)
    

    right below the Environment block.

    Then right click on your project node , select Properties, Build and add $(MYSQL_LIBS) to the Additional options parameter.

提交回复
热议问题