【发布时间】:2012-11-22 14:32:55
【问题描述】:
我正在使用 Eclipse Juno CDT。
我在我的项目中添加了以下内容:
- 包含路径设置的 mysql/includes 路径
- libmysql.lib 和 zlib.lib 到库设置
- 库路径设置的mysql库路径
现在,当我创建项目时,在运行应用程序时编译会引发错误。 这是构建:
10:08:56 **** Build of configuration Debug for project mysqlapp ****
make all
Building file: ../src/mysqlapp.c
Invoking: Cygwin C Compiler
gcc -I"C:\Program Files\MySQL\MySQL Connector C 6.0.2\include" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/mysqlapp.d" -MT"src/mysqlapp.d" -o "src/mysqlapp.o" "../src/mysqlapp.c"
cygwin warning:
MS-DOS style path detected: C:\Users\Yonaton\workspace\mysqlapp\Debug
Preferred POSIX equivalent is: /cygdrive/c/Users/Yonaton/workspace/mysqlapp/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
Finished building: ../src/mysqlapp.c
Building target: mysqlapp.exe
Invoking: Cygwin C Linker
gcc -L"C:\Program Files\MySQL\MySQL Connector C 6.0.2\lib\opt" -o "mysqlapp.exe" ./src/mysqlapp.o
Finished building target: mysqlapp.exe
这是 eclipse 中的运行:
10:09:55 **** Incremental Build of configuration Debug for project mysqlapp ****
make all
src/mysqlapp.d:1: *** multiple target patterns. Stop.
10:09:56 Build Finished (took 225ms)
【问题讨论】:
-
例如
LIBS应携带-lz -lmysql。 -
我认为您使用的是 Windows,gcc/cygwin 配置正确吗?
-
是的。它配置了eclipse。
-
错误信息添加到问题
-
您可能希望粘贴 Eclipse 的控制台输出以进行构建。
标签: mysql c eclipse makefile eclipse-cdt