编译MySQL连接器与Visual Studio 2015年Win64平台 [英] Compiling MySQL Connector with Visual Studio 2015 Win64

查看:908
本文介绍了编译MySQL连接器与Visual Studio 2015年Win64平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建具有CMake的解决方案后,我被放面对面与构建过程中在Visual Studio 1400的错误。
主要的问题是,似乎没有人编译连接器,只是使用precompiled库为他们的项目,更使在Windows上。
这里有一些误差,似乎的timespec正在被重新定义一个更多的时间,首先在,然后在第二时间在my_global.h,错误和下面。定义

After creating a solution with cmake, I am being put face to face with 1400 errors in Visual Studio during build. The main problem is, it seems no one compiles the connector, and just uses the precompiled library for their projects, more so on Windows. Here are some of errors, it seems timespec is being redefined one more time, first of all in ,and then a second time in my_global.h, errors and definitons below.

所以,问题是,到底如何做我解决1400错误?

So the question is, how the hell do I fix 1400 errors?

或者至少,一些意见如何摆脱重新定义的将是巨大的!

Or at least, some advice how to get rid of redefinition would be GREAT!

time.h中
     的#ifndef _CRT_NO_TIME_T
     结构的timespec
         {
            time_t的tv_sec; //秒 - > = 0
            长tv_nsec; //纳秒 - [0,999999999]
         };
     #万一
my_global.h

time.h #ifndef _CRT_NO_TIME_T struct timespec { time_t tv_sec; // Seconds - >= 0 long tv_nsec; // Nanoseconds - [0, 999999999] }; #endif my_global.h

 struct timespec {
    union ft64 tv;
    /* The max timeout value in millisecond for native_cond_timedwait */
    long max_timeout_msec;
 };

错误C2011'的timespec':'结构'重新定义类型(编译源文件C:\\ Users \\用户DDubinin \\下载\\ MySQL的连接器-C-6.1.6-SRC \\ MYSYS \\ my_mess.c)MYSYS C:\\用户\\ ddubinin \\下载\\ MySQL的连接器-C-6.1.6-src的\\包括\\ my_global.h 660

Error C2011 'timespec': 'struct' type redefinition (compiling source file C:\Users\DDubinin\Downloads\mysql-connector-c-6.1.6-src\mysys\my_mess.c) mysys c:\users\ddubinin\downloads\mysql-connector-c-6.1.6-src\include\my_global.h 660

错误C2039'电视':不是'的timespec成员(编译源文件C:\\用户\\ DDubinin \\下载\\ MySQL的连接器-C-6.1.6-SRC \\ MYSYS \\ my_malloc.c)MYSYSÇ :\\用户\\ ddubinin \\下载\\ MySQL的连接器-C-6.1.6-src的\\包括\\ my_global.h 681

Error C2039 'tv': is not a member of 'timespec' (compiling source file C:\Users\DDubinin\Downloads\mysql-connector-c-6.1.6-src\mysys\my_malloc.c) mysys c:\users\ddubinin\downloads\mysql-connector-c-6.1.6-src\include\my_global.h 681

错误C2227左' - >电视'必须指向类/结构/联合/通用型(编译源文件C:\\用户\\ DDubinin \\下载\\ MySQL的连接器-C-6.1.6-SRC \\的libmysql \\ authentication_win \\ handshake.cc)auth_win_client C:\\用户\\ ddubinin \\下载\\ MySQL的连接器-C-6.1.6-src的\\包括\\ my_global.h 681

Error C2227 left of '->tv' must point to class/struct/union/generic type (compiling source file C:\Users\DDubinin\Downloads\mysql-connector-c-6.1.6-src\libmysql\authentication_win\handshake.cc) auth_win_client c:\users\ddubinin\downloads\mysql-connector-c-6.1.6-src\include\my_global.h 681

错误C2227左' - > max_timeout_msec'必须指向类/结构/联合/通用型(编译源文件C:\\Users\\DDubinin\\Downloads\\mysql-connector-c-6.1.6-src\\libmysql\\authentication_win\\plugin_client.cc) auth_win_client C:\\用户\\ ddubinin \\下载\\ MySQL的连接器-C-6.1.6-src的\\包括\\ my_global.h 682

Error C2227 left of '->max_timeout_msec' must point to class/struct/union/generic type (compiling source file C:\Users\DDubinin\Downloads\mysql-connector-c-6.1.6-src\libmysql\authentication_win\plugin_client.cc) auth_win_client c:\users\ddubinin\downloads\mysql-connector-c-6.1.6-src\include\my_global.h 682

推荐答案

我将关闭这个问题,管理与旧,VS2013 64,版本的Visual Studio编译源,并CMake的4.3.1 ...

I'll close this issue, managed to compile the source with an older ,VS2013 x64, version of Visual Studio, and CMake 4.3.1 ...

看来,在Visual Studio 2015年新的变化正在打破C连接源$ C ​​$ C,我希望MySQL的团队将在未来的版本中解决这个问题。

It seems, the new changes in Visual Studio 2015 are breaking the C connector source code, I hope that MySQL team will fix this in a future release.

这篇关于编译MySQL连接器与Visual Studio 2015年Win64平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆