64-bit Windows compiled with 32-bit compilation platform but MySQL API

Source: Internet
Author: User
Tags mysql client

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.