MySQL的连接器C ++源代码从Visual Studio 2012中的64位版本 [英] MySQL Connector C++ 64bit build from source in Visual Studio 2012

查看:234
本文介绍了MySQL的连接器C ++源代码从Visual Studio 2012中的64位版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立的MySQL Connector C ++ 从源代码中的的Visual Studio 2012 64位架构。 据我所知,这取决于某些提振的头文件和 C连接。 运行的CMake 生成一个项目文件,但由于非常混乱的错误这可能需要做一些与包括文件和警告的一个更大的列表中的大名单中的项目文件不能编译。官方网站是没有什么帮助。

I am trying to build the mySQL Connector C++ from source in Visual Studio 2012 for the 64-bit architecture. I understand that it depends on some boost header files and the C connector. Running CMake produces a project file, but that project file doesn't compile because of a big list of very confusing errors which probably have to do something with the include files, and an even bigger list of warnings. The official site is of little help.

可能有人请列出成功编译C ++连接器所有的步骤是什么?

Could some one please list all the steps in successfully compiling the C++ Connector?

推荐答案

为了建造它,你需要具备以下条件:

In order to build it you need to have the following:

  1. 您需要安装任何MySQL服务器或 MySQL的C连接
  2. 在安装了升压或有源文件是C ++库。请注意,是不是需要建立提振,因为你只需要头文件。
  3. 有无 CMake的安装。当安装CMake的它会问你,如果你想让它包含在 PATH 变量,你应该选择yes,使其更容易以后使用它。
  1. You need to have installed either the MySQL server or the MySQL C Connector.
  2. Have installed the Boost C++ libraries or have the source files for it. Please note that there is not need to build boost as you only need the header files.
  3. Have CMake installed. When installing CMake it will ask you if you want it included in the PATH variable, you should select yes to make it easier later to use it.

一旦你把所有三个可用的,开放的 VS2012的x64原生工具命令提示符并从MySQL C ++连接器的源文件目录中,你需要发出以下内容:

Once you have all three available, open VS2012 x64 Native Tools Command Prompt and from the source root directory of the MySQL C++ Connector you need to issue the following:

set MYSQL_DIR=c:\PROGRA~1\MySQL\MYSQLC~1.1
cmake -G "Visual Studio 11 Win64" ^
      -DBOOST_ROOT:STRING=C:\Users\user\DOWNLO~1\BOOST_~1\BOOST_~1 ^
      -DMYSQL_LIB_DIR:STRING=c:\PROGRA~1\MySQL\MYSQLC~1.1\LIB
devenv.com MySQLCPPCONN.sln /build Release

第一个命令定义了 MYSQL_DIR 变量指向MySQL服务器或MySQL的C连接器的安装。 第二个命令调用cmake的,以prepare VS的项目,这将是64位。似乎有与 MYSQL_LIB_DIR 变量问题,它不会发生,因此我们需要手动定义它。 MYSQL_LIB_DIR MYSQL_DIR 结束与价值的 \ LIB 。 第三个命令是可选的,它会构建命令提示符项目,而无需打开VS。

The first command defines the MYSQL_DIR variable that points to the installation of the MySQL server or the MySQL C Connector. The second command call cmake to prepare a VS project that will be 64bit. There seems to be a problem with the MYSQL_LIB_DIR variable and it does not get generated, so we need to define it manually. MYSQL_LIB_DIR has the value of MYSQL_DIR ending with a \LIB. Third command is optional, it will build the project from command prompt without opening VS.

建议您使用的这些变量的DOS路径。 要做到这一点,导航到要转换为DOS路径,并调用的%我在目录(。)也呼应%〜的sI 。它会给你的转换路径。

It is recommended that you use the DOS paths for the variables. To do that, navigate to the directory you want to convert to DOS path and call for %I in (.) do echo %~sI. It will give you the converted path.

这篇关于MySQL的连接器C ++源代码从Visual Studio 2012中的64位版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆