Home > Database > Mysql Tutorial > visual studio-MySQL 连接不到libmysqllib

visual studio-MySQL 连接不到libmysqllib

WBOY
Release: 2016-06-06 09:33:36
Original
1270 people have browsed it

visual studiomysql数据

<code> #define _CRT_SECURE_NO_WARNINGS#include <windows.h>  #include <stdio.h>  #include <stdlib.h>  #include <string.h>  #include <mysql.h>   #include <iostream> #pragma comment(lib,"libmysql64.lib")//连接MysQL需要的库  #pragma comment(lib,"libmysql.lib")//连接MysQL需要的库  using namespace std;int main(){    const char user[] = "VISUAL_STUDIO1";         //username      const char pswd[] = "ligh123456789";    //password      const char host[] = "118.192.151.230";    //or"127.0.0.1"      const char table[] = "testdb";       //database      unsigned int port = 3306;           //server port              MYSQL myCont;    MYSQL_RES *result;    MYSQL_ROW sql_row;    MYSQL_FIELD *fd;    char column[32][32];    int res;    mysql_init(&myCont);    if (mysql_real_connect(&myCont, host, user, pswd, table, port, NULL, 0))    {        cout name);                }                j = mysql_num_fields(result);                for (i = 0; i<j i printf column while mysql_fetch_row for sql_row else cout sql failed endl if null mysql_free_result mysql_close return></j></iostream></mysql.h></string.h></stdlib.h></stdio.h></windows.h></code>
Copy after login

为什么运行结果会有这个::::::

错误 1 error LNK1104: 无法打开文件“libmysql64.lib” d:\用户目录\我的文档\Visual Studio 2013\Projects\MySQL\MySQL\LINK

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template