我正在尝试从源代码(在Windows 7上)发布MySQL Connector / C ++ 1.1.1的发布版本,以便我可以在Visual Studio的Win32项目中使用它(仅限mysqlcppconn.dll文件)我遵循了这些指示:
http://dev.mysql.com/doc/refman/5.1/en/connector-cpp-installation-source-windows.html
但是当我尝试执行命令 cmake -G“Visual Studio 10”时,我收到一条错误消息,指出无法找到Boost或其中的某些库。错误是:
C:\CMake 2.8\bin>cmake -G "Visual Studio 10"
CMake Warning (dev) in CMakeLists.txt:
A logical block opening on the line
C:/CMake 2.8/bin/CMakeLists.txt:39 (if)
closes on the line
C:/CMake 2.8/bin/CMakeLists.txt:41 (endif)
with mis-matching arguments.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Environment compile flags:
-- Environment link flags:
-- Could NOT find Boost
-- Could NOT find Boost
CMake Error at CMakeLists.txt:120 (MESSAGE):
Boost or some of its libraries found. If not in standard place please set
-DBOOST_ROOT:STRING=
-- Configuring incomplete, errors occurred!
首先,我尝试将文件夹boost_1_49_0复制到与CMake(C:\ CMake 2.8 \ bin)相同的目录,但这导致了同样的错误。然后我尝试设置-DBOOST_ROOT:STRING =变量,因为消息指示使用命令* cmake -DBOOST_ROOT:STRING = \ boost_1_49_0 *,但这也不起作用。
所以我的问题是:如何将变量设置为正确的值,以便找到Boost库? (我搜索谷歌的变量名称,但没有找到结果)?
答案 0 :(得分:2)
修正了它!我已将CMakeList文件中的BOOST_ROOT变量更改为正确的路径,然后最终工作。