| |

VerySource

 Forgot password?
 Register
Search
View: 1455|Reply: 6

About the problem of using C API connection between mysql and vc

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-2 08:20:01
| Show all posts |Read mode
Use vc to connect to mysql via c API ..

both include and lib were introduced,\MySQL Server 5.0\include
\..\MySQL Server 5.0\lib\debug

#include <mysql.h>

Compile error:
Compiling ...
StdAfx.cpp
c:\program files\mysql\mysql server 5.0\include\mysql_com.h (183): error C2146: syntax error: missing ';' before identifier 'fd'
c:\program files\mysql\mysql server 5.0\include\mysql_com.h (183): error C2501: 'SOCKET': missing storage-class or type specifiers
c:\program files\mysql\mysql server 5.0\include\mysql_com.h (183): error C2501: 'fd': missing storage-class or type specifiers
c:\program files\mysql\mysql server 5.0\include\mysql_com.h (347): error C2065: 'SOCKET': undeclared identifier
c:\program files\mysql\mysql server 5.0\include\mysql_com.h (347): error C2146: syntax error: missing ')' before identifier 's'
c:\program files\mysql\mysql server 5.0\include\mysql_com.h (348): error C2059: syntax error: ')'
Error executing cl.exe.

tt.exe-6 error (s), 0 warning (s)


Help, what is the problem and how to deal with it ...

Thank you..
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-21 02:30:01
| Show all posts
C++ wrapper of MySql C API <MySQL>

http://www.vckbase.com/code/viewcode.asp?id=2994
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-5 22:30:02
| Show all posts
Isn't it possible to use CAPI?
Reply

Use magic Report

0

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-8-5 23:15:01
| Show all posts
It seems to be a socket problem.

#include <winsock2.h>

Join ws2_32.lib
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-21 19:45:01
| Show all posts
Add one:

#include <winsock2.h>
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-26 10:00:01
| Show all posts
Add before #include <mysql.h>
#include <winsock.h>
Reply

Use magic Report

0

Threads

20

Posts

17.00

Credits

Newbie

Rank: 1

Credits
17.00

 China

Post time: 2020-8-26 10:45:01
| Show all posts
Plus
#include <stdio.h>
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list