I'm having trouble in general trying to get anything MySQL to work in C on Windows.
My Code is as simple as this and it won't compile:
Code:
#include <mysql.h>
#include <stdio.h>
int main()
{
return 0;
}
My error list consists has been posted at the end. I haven't even included all of it since there is way too much. These however, are the errors in ascending order.
This was compiled using Dev C++, but I have also tried using MinGW and Visual C with very similar if not identical errors.
I've searched through MySQL documentation to no avail. I've installed MySQL Connector/C (libmysql) at this link: MySQL :: Download Connector/C 6.0
I'm not exactly sure if I have placed the header files in the correct directories or not, but my program seems to at least find the mysql.h.
Maybe I need to include some libraries when I compile but I'm so dead stuck I have no idea.
Any help or basic guides from scratch would be extremly helpful
Thanks, Chad.
Code:
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\Documents and Settings\Chad1\Desktop\src\sql2.c" -o "C:\Documents and Settings\Chad1\Desktop\src\sql2.exe" -fexceptions -g3 -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:/Documents and Settings/Chad1/Desktop/ssrc/sql2.c:6:23: arpa/inet.h: No such file or directory
C:/Documents and Settings/Chad1/Desktop/src/sql2.c:8:24: sys/socket.h: No such file or directory
C:/Documents and Settings/Chad1/Desktop/src/sql2.c:9:25: netinet/tcp.h: No such file or directory
C:/Documents and Settings/Chad1/Deskto/src/sql2.c:10:24: netinet/ip.h: No such file or directory
C:/Documents and Settings/Chad1/Desktop/src/sql2.c:11:24: netinet/in.h: No such file or directory
C:/Documents and Settings/Chad1/Desktop/src/sql2.c:12:19: netdb.h: No such file or directory
In file included from C:/Dev-Cpp/include/mysql.h:71,
from C:/Documents and Settings/Chad1/Desktop/src/sql2.c:14:
C:/Dev-Cpp/include/mysql_com.h:268: parse error before "SOCKET"
C:/Dev-Cpp/include/mysql_com.h:268: warning: no semicolon at end of struct or union
C:/Dev-Cpp/include/mysql_com.h:304: parse error before '}' token
C:/Dev-Cpp/include/mysql_com.h:304: warning: data definition has no type or storage class
C:/Dev-Cpp/include/mysql_com.h:418: parse error before '*' token
C:/Dev-Cpp/include/mysql_com.h:419: parse error before '*' token
C:/Dev-Cpp/include/mysql_com.h:420: parse error before '*' token
C:/Dev-Cpp/include/mysql_com.h:421: parse error before '*' token
C:/Dev-Cpp/include/mysql_com.h:422: parse error before '*' token
C:/Dev-Cpp/include/mysql_com.h:423: parse error before '*' token
C:/Dev-Cpp/include/mysql_com.h:424: parse error before '*' token
C:/Dev-Cpp/include/mysql_com.h:425: parse error before '*' token
C:/Dev-Cpp/include/mysql_com.h:428: parse error before '*' token
C:/Dev-Cpp/include/mysql_com.h:429: parse error before '*' token
C:/Dev-Cpp/include/mysql_com.h:437: parse error before "s"
In file included from C:/Documents and Settings/Chad1/Desktop/src/sql2.c:14:
C:/Dev-Cpp/include/mysql.h:237: parse error before "NET"
C:/Dev-Cpp/include/mysql.h:237: warning: no semicolon at end of struct or union
C:/Dev-Cpp/include/mysql.h:262: `scramble' redeclared as different kind of symbol
C:/Dev-Cpp/include/mysql_com.h:511: previous declaration of `scramble'
C:/Dev-Cpp/include/mysql.h:264: conflicting types for `unused2'
C:/Dev-Cpp/include/mysql_com.h:283: previous declaration of `unused2'
C:/Dev-Cpp/include/mysql.h:264: conflicting types for `unused3'
C:/Dev-Cpp/include/mysql_com.h:285: previous declaration of `unused3'