mysql - 在 VC++ 中使用 MySQL

标签 mysql visual-c++

我正在尝试使用 C++ 连接到 MySQL。我使用的 IDE 是 Visual C++ 2010。我按照 MySQL 开发页面 (http://dev.mysql.com/tech-resources/articles/mysql-connector-cpp.html) 上的步骤操作。尽管我使用了不同的操作系统 (Windows),但我完全按照给定的步骤进行操作。我在这个过程中遇到了很多链接器错误,我发现这些错误很难调试。有人可以指导我采用更好或更简单的方法来使用 C++ 访问 MySQL。

附言我已经下载了适用于 C++ 的 mysqlconnector。

最佳答案

你可以试试mysql++ ,但我敢打赌您会遇到相同的链接器错误。

是否设置了包含路径(C:...\MySQL Server 5.1\include)和库路径(C:...\MySQL Server 5.1\lib\debug)?在 VC2010 中设置全局设置你必须:

VS2010 introduces the user settings file (Microsoft.cpp..users.props) to control global settings including Global search path. These files are located at $(USERPROFILE)\appdata\local\microsoft\msbuild\v4.0 directory.

The issue you are seeing is a bug in the UI. To make it possible to change the ordering of these read-only directories, here is the workaround that you can apply:

  1. open up the property manager,
  2. right click on the .user.props file to bring up the property page
  3. open up VC++ Directories -> Include Directories, add new paths after $(IncludePath)
  4. Click on the "Edit" dropdown on VC++ Directories -> Include Directories property, the user directories as well as the inherited values will show up in the upper pane
  5. you can move the directory orders as you wish and save.

http://connect.microsoft.com/VisualStudio/feedback/details/550946/vs-2010-how-to-change-vc-directories-inherited-values-read-only

关于mysql - 在 VC++ 中使用 MySQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3459457/

相关文章:

mysql - SQL Puppy 数据库 : Trying to make a specific query using inner joins, 卡住了?

c++ - 无法在动态链接库 dbghelp.dll 中定位过程入口点 EnumerateLoadedModulesW64

c++ - MFC : Fix a console on a GUI

php - 每 24 小时重置一次列的值

php - MongoDB 作为 MySQL 缓存

MySQL 不返回空列连接值

C++将二维整数数组插入另一个二维整数数组

c++ - 项目无法与 libcurl 静态库链接

visual-studio - 有什么办法让Delphi读取其他调试格式?

mysql - winform查询中需要什么连接打开和关闭执行?