简体   繁体   English

如何为Mac OS X安装MySQL Connector C ++(使用终端)?

[英]How to install MySQL Connector C++ for Mac OS X (using Terminal)?

I downloaded the MySQL Connector/C++ source tree, which has an 'include' and a 'lib' directory. 我下载了MySQL Connector / C ++源代码树,该树具有一个“ include”和一个“ lib”目录。 Now I'm following the README.txt. 现在,我正在关注README.txt。 I download CMake which launches as a program with a UI. 我下载了CMake,它作为带有UI的程序启动。 The first step of the installation says 安装的第一步说

me@host:/path/to/mysql-connector-cpp> cmake .

I can't make much sense of this. 我对此不太了解。 Does this mean to cd into the directory of the source tree and then run cmake? 这是否意味着cd进入源代码树的目录,然后运行cmake? On what file? 在什么文件上?

I found this this thread and these instructions but they seem unique to installation using the Xcode UI and I don't know how to apply them in the Terminal. 我找到了该线程这些说明,但是它们似乎是使用Xcode UI进行安装的唯一方法,而且我不知道如何在终端中应用它们。 I plan on compiling / running the C++ with g++. 我打算用g ++编译/运行C ++。

Thanks, 谢谢,

fertileneutrino 肥沃的中微子

Yes, it does mean - go to the root directory of the source distribution and type cmake . 是的,这确实意味着-转到源分发的根目录,然后键入cmake . . As for the file, the default file for CMake is CMakeList.txt , so you don't have to specify it. 至于文件,CMake的默认文件是CMakeList.txt ,因此您不必指定它。 You can also run cmake in other directories and specify the path to the source root directory as a second argument. 您还可以在其他目录中运行cmake,并将源根目录的路径指定为第二个参数。 For example, a very common way of building projects is this: 例如,一种非常常见的构建项目的方式是:

$ cd project-sources
$ mkdir build
$ cd build
$ cmake ..
$ make
$ make install

That way, all generated files can be simply nuked by removing the build directory, for example: rm -rf build . 这样,可以通过删除构建目录来简单地对所有生成的文件进行操作,例如: rm -rf build

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM