我尝试将Netbeans(7.3,Windows 7)中的mysql-connector 1.1.3与Mingw-Compiler链接到我的c ++项目。 在项目属性中,我在“包含的Directorys”和Linker“Additionell Linker Directorys”下添加了所有mysql-connector目录(include,lib,cppcon)。我添加了升级库。 但在编译器输出中总是说:
致命错误: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.o.d 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'
答案 0 :(得分:0)
这应该是你要找的东西:
库通常驻留在自己的安装目录中,因此您需要将NB指向它所在的位置。如果在“项目”窗口中右键单击项目名称,则将具有“属性”选项。