gpt4 book ai didi

mysql - 在 VC++ 中使用 MySQL

转载 作者:行者123 更新时间:2023-11-30 23:40:34 26 4
gpt4 key购买 nike

我正在尝试使用 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com