PDA

View Full Version : Include files in mysql


d98rolb
04-28-2003, 04:32 PM
I have downloaded the free version of QT and build a graphical shell with QT designed. This runs fine after a compilation with VC++ 6.0.
Now I want to add mysql-functions by linking with a mysql lib-file.

But this didn't work at all. When I include mysql.h without any mysql-code in my program I get this errormessage:

c:\mysql\include\mysql_com.h(116) : error C2146: syntax error : missing ';' before identifier 'fd'

This seems normal as the compiler didn't have a clue what my_socket is in line 116 mysql_com.h.

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

After some research I found this in my_global.h that now is included:

typedef int my_socket; /* File descriptor for sockets */

But now this errormessage appears:

c:\mysql\include\my_global.h(420) : error C2040: 'pchar' : 'int' differs in levels of indirection from 'char *'

Why aren't all include-files independent of each other and include the files they need? This was how it works when I made programs for Amiga and it works great. I must have missed something important, because the guys at MySQL aren't any newbies:-)

Anyone who understand why, please answer me!

Regards Roland