【问题标题】:Eclipse CDT MySql unknown type name ‘ulong’Eclipse CDT MySql 未知类型名称‘ulong’
【发布时间】:2015-09-28 22:32:50
【问题描述】:

我正在尝试编译一个使用 MySql 的 c 程序。我在 Ubuntu 14.04 上使用 Eclipse CDT,我已经从终端执行了 sudo apt-get install libmysqlclient-dev。在 Eclipse 中构建程序时,我得到了 ulong、uint 等的一系列“未知类型名称”

代码

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


int main(void) {
    puts("!!!Hello World!!!"); 
    printf("MySQL client version: %s\n", mysql_get_client_info());
    return EXIT_SUCCESS;
}

在项目/构建项目(或项目/清理)上,我得到:

08:20:26 **** Build of configuration Debug for project CTest1 ****
make all 
Building file: ../src/CTest1.c
Invoking: GCC C Compiler
gcc -std=c99 -I/usr/include/mysql -O0 -g3 -Wall -lmysqlclient -MMD -MP -MF"src/CTest1.d" -MT"src/CTest1.d" -o "src/CTest1.o" "../src/CTest1.c"

In file included from ../src/CTest1.c:14:0:
/usr/include/mysql/my_global.h:971:1: error: unknown type name ‘ulong’
 typedef ulong nesting_map;  /* Used for flags of nesting constructs */

^

我错过了什么? BTW 编译并运行了一个不使用 mysql 的简单 c 程序。

【问题讨论】:

    标签: mysql c ubuntu-14.04 eclipse-cdt


    【解决方案1】:

    设置...

    #include <my_global.h>
    ...
    

    ...作为第一个包含。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-26
      • 1970-01-01
      • 2014-11-19
      • 2018-10-27
      • 2016-09-16
      • 2012-04-03
      • 2017-01-09
      相关资源
      最近更新 更多