我尝试将 Netbeans(7.3,Windows 7)中的 mysql-connector 1.1.3 与 Mingw-Compiler 链接到我的 c++ 项目。在项目属性中,我在“包含的目录”和链接器“Additionell 链接器目录”下添加了所有 mysql-connector 目录(包括、lib、cppcon)。我将 boost 库添加到。但在编译器输出中总是说:
致命错误:mysql_connection.h:没有这样的文件或目录
对不起我的英语不好,谢谢你的帮助......
完整的输出:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf make[1]: 进入目录
/cygdrive/c/Users/Toni/Desktop/dev/Wiesel/new/tests/sql_test2' "/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/sql_test2.exe make[2]: Entering directory
/cygdrive/c/Users/Toni/Desktop/dev/Wiesel/new/tests /sql_test2' mkdir -p build/Debug/MinGW-Windows rm -f build/Debug/MinGW-Windows/main.od g++ -c -g -I/D/libs/mysql-connector-c++-noinstall-1.1.3 -win32 -I/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/include -I/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/include/cppconn -I /D/libs/mysql-connector-c++-noinstall-1.1.3-win32/lib -I/D/libs/boost_1_53_0 -I/D/libs/boost_1_53_0/boost -I/D/libs/boost_1_53_0/libs -MMD -MP -MF build/Debug/MinGW-Windows/main.od -o build/Debug/MinGW-Windows/main.o main.cpp main.cpp:9:30:致命错误:mysql_connection.h:没有这样的文件或目录编译终止。nbproject/Makefile-Debug.mk:66:build/Debug/MinGW-Windows/main.o' failed make[2]: [build/Debug/MinGW-Windows/main.o] Error 1 (ignored) mkdir -p dist/Debug/MinGW-Windows g++ -o dist/Debug/MinGW-Windows/sql_test2 build/Debug/MinGW-Windows/main.o -L/D/libs/boost_1_53_0/boost -L/D/libs/boost_1_53_0/libs -L/D/libs/mysql-connector-c++-noinstall-1.1.3-win32 -L/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/include -L/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/include/cppconn -L/D/libs/mysql-connector-c++-noinstall-1.1.3-win32/lib -lmysqlcppconn -lmysqlcppconn-static -lmysqlcppconn -static g++.exe: error: build/Debug/MinGW-Windows/main.o: No such file or directory nbproject/Makefile-Debug.mk:62: recipe for target
dist/Debug/MinGW-Windows/sql_test2.exe' 失败 make[2]: [dist/Debug/MinGW-Windows/sql_test2.exe] 错误 1 (忽略) make[2]: 离开目录/cygdrive/c/Users/Toni/Desktop/dev/Wiesel/new/tests/sql_test2' make[1]: Leaving directory
/cygdrive/c/Users/ Toni/Desktop/dev/Wiesel/new/tests/sql_test2'