【发布时间】:2011-04-27 13:21:19
【问题描述】:
我正在编译一个简单的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;
}
我得到编译器错误
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
我已经验证了my_global.h文件,这些减速似乎是有效的。
- 如何解决这些重定义错误?
- 在 Eclipse 中的位置以及如何设置此“CYGWIN 环境变量选项“nodosfilewarning”以关闭此警告”。
这里可以看到
的头文件my_global.h【问题讨论】:
-
编译器指出重复的确切行。这不正确吗?
-
:|抱歉没有超载。我已将链接粘贴到头文件。我假设源文件应该没有问题,因为它是 oracle 给出的 mysql c 连接器的标头。
-
他们确实定义了相同的宏,具体取决于其他一些宏(可能来自配置?)。我无法通过 1000 行嵌套的#ifdefs,所以不能确切地说出了什么问题。
-
您可能进行了 grep/函数搜索。您说他们依赖 #ifdefs 是对的。您将如何运行此程序?你能检查一下吗? dev.mysql.com/downloads/connector/c/#downloads 包含在项目中并编译。
标签: mysql c eclipse compiler-warnings