What happened a week ago, when I wanted to feel the MySQL C API, I wrote a few small examples. Although it is on Windows (my work computer is 64-bit Windows) above, but do not want to use VS, just want to write the code with the text software and compile with CL, and then use the link links. Just after I've written the simplest example, it doesn't compile. The code is as follows:
#include <my_global.h><mysql.h>int main (intChar * *argv) { printf ("MySQL Client version:%s\n", Mysql_get_client_info ()); return 0 ;}
I thought my cl command was not written correctly, although I checked N times and did not find an error. Then I use VS to create a new project, so that the compiler command will not be wrong, I go, and really do not compile the past, said is unable to find the definition of mysql_get_client_info. Because I never felt the difference between Win32 and Win64 programming, so I didn't think about it. N times after or can not find out the reason, only a variety of search, finally found that someone and I met the same problem. I just don't have that kid's shoe. Smart, can calm down to think about analysis, to find the problem. Because I initially felt Win32 and Win64 no difference, so I have been compiling commands to find the reason.
As the child's shoe indicates, there is a real problem with the 32-bit compilation environment in 64-bit systems. The children's shoes because of the use of VS, so TA is right-click on the selected item----Properties, Configuration Manager, a new 64-bit platform, use this platform to compile the solution. I don't want to use VS, so I'm using the VS bring-it-yourself environment, like.
Select with x64.
Finally: After meeting the problems caused by the differences between Win32 and Win64, the impression deepened a lot.
64-bit Windows compiled with 32-bit compilation platform but MySQL API