【问题标题】:Building MySQL Connector/C++ from source (can't find Boost libraries error)从源代码构建 MySQL 连接器/C++(找不到 Boost 库错误)
【发布时间】:2012-10-29 21:08:18
【问题描述】:

我正在尝试从源代码(在 Windows 7 上)制作 MySQL Connector/C++ 1.1.1 的发布版本,以便我可以在 Visual Studio 的 Win32 项目中使用它(仅限 mysqlcppconn.dll 文件) 2010. 我遵循了这些指示:

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),但这导致了同样的错误。然后,我尝试使用命令 *cmake -DBOOST_ROOT:STRING=\boost_1_49_0* 设置 -DBOOST_ROOT:STRING= 变量,如消息所示,但这也不起作用。

所以我的问题是:如何将变量设置为正确的值,以便可以找到 Boost 库? (我在变量名称上搜索了谷歌,但没有找到结果)?

【问题讨论】:

  • 你为什么不使用GUI?有一个用于创建新变量的按钮。
  • 我已经能够在 CMakeList 文件中手动设置变量,但下次我会尝试 GUI。

标签: c++ boost build cmake


【解决方案1】:

修好了!我已经将CMakeList文件中的BOOST_ROOT变量改成了正确的路径,终于成功了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-23
    • 1970-01-01
    • 2011-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多