1

I am tring to connect to a MySQL database from Visual Studio 2013 C++. I included the MySQL "include" folder in Property -> C/C++ -> MySQL\include and in Linker -> Input -> MySQL\lib\libmysql.lib. But I got the following error in mysql_com.h, in this line:

  my_socket fd;                 /* For Perl DBI/dbd */

Error:

1>d:\web_server\mysql\include\mysql_com.h(320): error C2146: syntax error : missing ';' before identifier 'fd'
1>d:\web_server\mysql\include\mysql_com.h(320): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

If I comment this line (//) -> no error; But if I try to add

MYSQL *con = mysql_init(NULL);

to code, I get:

1>mysqltest.obj : error LNK2019: unresolved external symbol _mysql_init@4 referenced in function "void __cdecl `dynamic initializer for 'con''(void)" (??__Econ@@YAXXZ)
1>D:\Info\cvis\mysqltest\Debug\mysqltest.exe : fatal error LNK1120: 1 unresolved externals

I tried this, but no good result.

Help :D ?

Community
  • 1
  • 1
Andrei Damian
  • 396
  • 2
  • 6
  • 16

0 Answers0