C MySQL API编译器在包含头文件时出现重新定义警告问题

C MySQL API编译器在包含头文件时出现重新定义警告问题,mysql,c,eclipse,compiler-warnings,Mysql,C,Eclipse,Compiler Warnings,我正在编译一个简单的c程序来测试eclipse cygwin环境中库文件的包含mysql-connector-c-6.0.2 节目 #include <my_global.h> #include <mysql.h> int main(int argv,char* argc[]) { printf("my SQL libraries successfully included\n"); return 0; } 我已经验证了my_global.h文件

我正在编译一个简单的c程序来测试eclipse cygwin环境中库文件的包含
mysql-connector-c-6.0.2
节目

#include <my_global.h>
#include <mysql.h>
int main(int argv,char* argc[])
{
        printf("my SQL libraries successfully included\n");
    return 0;
}
我已经验证了my_global.h文件,这些文件的减速似乎是有效的

  • 如何扭转这些重新定义的错误
  • 在eclipse中的何处以及如何设置此“CYGWIN环境变量选项”nodosfilewarning“以关闭此警告”

  • 在这里您可以看到

    的头文件。对于警告,请在操作系统环境(控制面板->系统->高级->环境变量)中定义
    CYGWIN=nodosfilewarning
    。如果这不起作用,请尝试注销以确保没有任何东西正在使用旧环境


    对于重定义错误,正如Bo所说,编译器会告诉您错误的确切位置。如果您不理解,那么您至少应该将这些行作为问题的一部分发布。

    编译器指出重复的确切行。不正确吗?:|抱歉,没有过载。我已将链接粘贴到头文件。我的假设是,源文件应该没有问题,因为它是oracle提供的mysql c connector的头文件。它们确实定义了相同的宏,这取决于其他一些宏(可能来自配置?)。我无法跟踪1000行嵌套的ifdef,因此无法准确说出错误所在。您可能进行了grep/函数搜索。您说它们依赖于ifdef是正确的。您将如何运行此程序?你能检查一下吗?包含在项目和编译中。我已经发布了头文件的链接。您能告诉我需要什么类型的编译器设置吗?。它是sql c连接的标准库。这取决于您想要的行为。您需要查看其中的所有
    #ifdef/#else/#endif
    声明,以确定您认为应该包括哪些部分,然后确定供应商为什么将其设计为包含相同
    #define
    的不同版本。我对重新定义的函数进行了注释。在那一点上留下一个标记,以检查将来是否有任何东西断裂。
    cygwin warning:
      MS-DOS style path detected: C:\MinGW\Workspace\sql_test\Debug
      Preferred POSIX equivalent is: /cygdrive/c/MinGW/Workspace/sql_test/Debug
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
    In file included from ../sql_test.c:8:
    D:\mysql-connector-c-6.0.2\include/my_global.h:1416:1: warning: "floatget" redefined
    D:\mysql-connector-c-6.0.2\include/my_global.h:1232:1: warning: this is the location of the previous definition
    D:\mysql-connector-c-6.0.2\include/my_global.h:1417:1: warning: "floatstore" redefined
    D:\mysql-connector-c-6.0.2\include/my_global.h:1231:1: warning: this is the location of the previous definition
    D:\mysql-connector-c-6.0.2\include/my_global.h:1418:1: warning: "doubleget" redefined
    D:\mysql-connector-c-6.0.2\include/my_global.h:1220:1: warning: this is the location of the previous definition
    D:\mysql-connector-c-6.0.2\include/my_global.h:1419:1: warning: "doublestore" redefined
    D:\mysql-connector-c-6.0.2\include/my_global.h:1225:1: warning: this is the location of the previous definition
    Finished building: ../sql_test.c