OS: Windows XP sp3

IDE: VS2010

MariaDB: V5.5

(到目前为止2016.5,中文域(.cn)只有清华大学 TUNA 镜像源可用)

(.tar.gz为源码;.zip为执行程序)

Source: https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-5.5.49/source/mariadb-5.5.49.tar.gz

Zip: https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-5.5.49/win32-packages/mariadb-5.5.49-win32.zip

首先安装如下工具和Boost库:

(1) Bazzar

https://launchpad.net/bzr/2.5/2.5.1/+download/bzr-2.5.1-1-setup.exe

(2) Bison from GnuWin32

http://jaist.dl.sourceforge.net/project/gnuwin32/bison/2.4.1/bison-2.4.1-setup.exe

(3) Cmake

https://cmake.org/files/v3.4/cmake-3.4.3-win32-x86.exe

V3.4.3是可以在XP中运行的。

Boost库:

(1) 下载

http://www.boost.org/users/download/

当前最新版本为V1.61.0

(2) 设置系统变量

a. BOOST_HOME

C:\boost_1_61_0

b. 增加变量到path

然后执行编译:

检查系统变量path,以保证包含如下设置:

C:\Program Files\Bazaar;C:\GnuWin32\bin;C:\boost_1_61_0;C:\Program Files\CMake\bin

(1)cmake ..

Microsoft Windows XP [版本 ]
(C) 版权所有 - Microsoft Corp.

C:\Documents and Settings\Administrator>d:

D:\>cd mariadb-

D:\mariadb->mkdir bld

D:\mariadb->cd bld

D:\mariadb-\bld>cmake ..
-- Building
-- Running cmake version
-- The C compiler identification is MSVC 16.0.40219.1
-- The CXX compiler identification is MSVC 16.0.40219.1
-- Check
-- Check   -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check
-- Check   -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for isnan
-- Looking for isnan - not found
-- Looking for snprintf
-- Looking for snprintf - not found
-- Looking for _snprintf
-- Looking for _snprintf - found
-- MariaDB
-- Check size of void *
-- Check size of void * - done
-- Packaging as: mariadb--win32
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Looking for isnan
-- Looking for isnan - not found
-- Check size of time_t
-- Check size of time_t - done
-- Performing Test STRUCT_TIMESPEC_HAS_TV_SEC
-- Performing Test STRUCT_TIMESPEC_HAS_TV_SEC - Failed
-- Performing Test STRUCT_TIMESPEC_HAS_TV_NSEC
-- Performing Test STRUCT_TIMESPEC_HAS_TV_NSEC - Failed
-- Looking for malloc_stats_print in jemalloc
-- Looking for malloc_stats_print in jemalloc - not found
-- Performing Test HAVE_WVLA
-- Performing Test HAVE_WVLA - Failed
-- Performing Test HAVE_WERROR
-- Performing Test HAVE_WERROR - Failed
-- Boost version:
-- Performing Test HAVE_XUCRED
-- Performing Test HAVE_XUCRED - Failed
-- Looking for MFC
-- Looking for MFC - found
-- Configuring done
-- Generating done
-- Build files have been written to: D:/mariadb-/bld

D:\mariadb-\bld>

(2) sql/sql_locale.cc

使用UE打开此文件并另存为同名。不同之处在于,更改“Format”!

(3) 生成

cmake --build . --config Relwithdebinfo

最后,拷贝文件。

拷贝以下两个文件覆盖到D:\progFiles\MariaDB55\bin,以替换不能在XP运行的程序。

bld\sql\RelWithDebInfo\mysqld.exe

bld\sql\RelWithDebInfo\mysqld.pdb

FAQ:

1. error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE'

在进行storage\oqgraph目录编译时发生错误。

编译日志:file:///D:/mariadb-5.5.49/bld/storage/oqgraph/oqgraph.dir/RelWithDebInfo/BuildLog.htm

Build Log

Build started: Project: oqgraph, Configuration: RelWithDebInfo|Win32

Command Lines

Creating temporary file "d:\mariadb-5.5.49\bld\storage\oqgraph\oqgraph.dir\RelWithDebInfo\RSP00015042369588.rsp" with contents
[
/O2 /Ob1 /I "C:\boost_1_61_0" /I "D:\mariadb-5.5.49\bld\include" /I "D:\mariadb-5.5.49\include" /I "D:\mariadb-5.5.49\sql" /I "D:\mariadb-5.5.49\regex" /I "D:\mariadb-5.5.49\extra\yassl\include" /I "D:\mariadb-5.5.49\extra\yassl\taocrypt\include" /I "D:\mariadb-5.5.49\zlib" /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "DBUG_OFF" /D "MYSQL_DYNAMIC_PLUGIN" /D "__WIN__" /D "_CRT_SECURE_NO_DEPRECATE" /D "_WIN32_WINNT=0x0501" /D "NOMINMAX" /D "WIN32_LEAN_AND_MEAN" /D "HAVE_CONFIG_H" /D "HAVE_OQGRAPH" /D "CMAKE_INTDIR=\"RelWithDebInfo\"" /D "oqgraph_EXPORTS" /D "_WINDLL" /D "_MBCS" /FD /EHsc /MT /Fo"oqgraph.dir\RelWithDebInfo\\" /Fd"oqgraph.dir\RelWithDebInfo\vc90.pdb" /W3 /c /Z7 /TP /wd4800 /wd4805 /wd4996 /wd4291   /MP /we4099

"..\..\..\storage\oqgraph\graphcore.cc"

"..\..\..\storage\oqgraph\ha_oqgraph.cc"
]
Creating command line \bld\storage\oqgraph\oqgraph.dir\RelWithDebInfo\RSP00015042369588.rsp" /nologo /errorReport:queue"
Output Window

Compiling...
graphcore.cc
ha_oqgraph.cc
C:\boost_1_61_0\boost/type_traits/detail/common_arithmetic_type.hpp : warning C4819: The ). Save the file in Unicode format to prevent data loss
C:\boost_1_61_0\boost/graph/named_graph.hpp() : error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE'
        with
        [
            x=false
        ]
        C:\boost_1_61_0\boost/graph/detail/adjacency_list.hpp() : see reference to function template instantiation 'void boost::graph::named_graph::removing_vertex(Vertex,VertexIterStability)' being compiled
        with
        [
            Graph=boost::adjacency_list,
            Vertex=unsigned int,
            VertexProperty=open_query::VertexInfo,
            VertexIterStability=boost::graph_detail::unstable_tag
        ]
        ..\..\..\storage\oqgraph\graphcore.) : see reference to function template instantiation 'void boost::remove_vertex::config,boost::bidirectional_graph_helper_with_property>(unsigned int,boost::vec_adj_list_impl &)' being compiled
        with
        [
            Graph=boost::adjacency_list,
            VertexListS=boost::vecS,
            OutEdgeListS=boost::vecS,
            DirectedS=boost::bidirectionalS,
            VertexProperty=open_query::VertexInfo,
            EdgeProperty=open_query::EdgeInfo,
            GraphProperty=boost::no_property,
            EdgeListS=boost::listS,
            Config=boost::detail::adj_list_gen,boost::vecS,boost::vecS,boost::bidirectionalS,open_query::VertexInfo,open_query::EdgeInfo,boost::no_property,boost::listS>::config,
            Base=boost::bidirectional_graph_helper_with_property,boost::vecS,boost::vecS,boost::bidirectionalS,open_query::VertexInfo,open_query::EdgeInfo,boost::no_property,boost::listS>::config>
        ]
Results

Build log was saved at "file://d:\mariadb-5.5.49\bld\storage\oqgraph\oqgraph.dir\RelWithDebInfo\BuildLog.htm"
oqgraph -  error(s),  warning(s)

Build Log

解决办法:

注释掉named_graph.hpp(C:\boost_1_61_0\boost\graph)的314行代码。

参考文档:

1. Building MariaDB on Windows

https://mariadb.com/kb/en/mariadb/Building_MariaDB_on_Windows/

2. 关于mysqld不是有效的win32程序

http://www.cnblogs.com/xiaobin-hlj80/p/5500152.html

3. 安装boost库(Windows)

http://www.cnblogs.com/xiaobin-hlj80/p/5503842.html

在windows编译MariaDB的更多相关文章

  1. OGRE 2.1 Windows 编译

    版权所有,转载请注明链接 OGRE 2.1 Windows 编译 环境: Windows 7 64Bit Visual Studio 2012 OGRE 2.1 CMake 2.8.12.1 OGRE ...

  2. Windows编译ejabberd

    Windows编译ejabberd(金庆的专栏)安装 erlang OTP. 添加路径到 PATH, 使 erl 可以运行.git clone ejabberd安装 rebar:git clone g ...

  3. 【转载】OGRE 2.1 Windows 编译

    OGRE 2.1 Windows 编译 环境: Windows 7 64Bit Visual Studio 2012 OGRE 2.1 CMake 2.8.12.1 OGRE: OGRE官方推出了最新 ...

  4. CEF3.2623使用记录:windows编译

    CEF3.2623使用记录:windows编译 1:cef3.2623下载地址 2623是cef3最后一个支持xp系统的版本,且可以支持html的audio标签,可以用作对html音频的处理下载地址为 ...

  5. Windows 编译安装 nginx 服务器 + rtmp 模块

    有关博客: <Windows 编译安装 nginx 服务器 + rtmp 模块>.<Ubuntu 编译安装 nginx>.<Arm-Linux 移植 Nginx> ...

  6. php beast windows编译教程

    git clone https://github.com/Microsoft/php-sdk-binary-tools.git c:\php-sdk cd c:\php-sdk git checkou ...

  7. Windows编译Nginx源码

    Windows下的Nginx战役,人不作就不会死!就像是拿着麦当劳的优惠券去买肯德基一样,别扭啊 Nginx是一款轻量级的Web 服务器.反向代理服务器.邮件服务器等等集一大串荣誉于一身的大牌人物!他 ...

  8. Windows编译安装OpenSSL

    windows下使用vs2008中的nmake编译安装openssl的脚本build.bat: echo off & color 0A :: 项目名称 set PROJECT=openssl ...

  9. 专题:Windows编译x264、SDL、faac、ffmpeg过程

    Windows上编译ffmpeg完整过程,包括编译x264.SDL.faac.在Windows上编译ffmpeg需要用MinGW+msys,本专题用于记录编译过程中遇到的各种问题及解决方法,转载请注明 ...

随机推荐

  1. 最小生成树——prim算法

    prim算法是选取任意一个顶点作为树的一个节点,然后贪心的选取离这棵树最近的点,直到连上所有的点并且不够成环,它的时间复杂度为o(v^2) #include<iostream>#inclu ...

  2. 课堂笔记-background属性

    一,background-position:(图片定位)   三种写法:   1):按%比,左上角最小(0%,0%),右下角最大(100%,%100):   2):(x,y)左上角最小(0,0),右下 ...

  3. Beta版本测试报告

    爬虫测试: 由于爬虫是整个系统的数据来源,十分的重要,但是由于引用了jar包并且运行复杂,这里主要做功能性测试,通过增加seed,运行爬虫,可以在后台控制台看到日志的不断刷新以及数据库条目的不断增加, ...

  4. IDEA IntelliJ常用设置以及快捷键(转)

    转载自:http://macrochen.iteye.com/blog/1035680 关于字体的设置 IDEA下使用雅黑Consolas混合字体      快捷贱, 快捷贱 , 快捷键贱    In ...

  5. UVA1003(dfs+进制转换)

    题意:输入很多字符的16进制数,现在需要你先转化为2进制,之后二进制中1和0组成的字符需要你求出来. 思路:字符每一个都有所不同可以靠圆圈的数目求出. #include<cstdio> # ...

  6. 开始使用Pyhton

    安装 第一个Python程序 首先我们打开python 交互式解释器, 执行如下命令: Python 3.5.1+ (default, Mar 30 2016, 22:46:26) [GCC 5.3. ...

  7. eclipse+spket+Extjs4.2.1开发环境搭建

    一.开发工具配置   1.http://www.eclipse.org/downloads/下载Eclipse,解压.         2.http://spket.com/download.html ...

  8. [Spring MVC] - JSON

    Spring MVC中使用JSON,先必需引用两个包:jackson-core-asl-1.9.13.jar.jackson-mapper-asl-1.9.13.jar 因为需要使用到jquery测试 ...

  9. 认识UML类图元素

    在Visio里,包和类的关系是包含关系,将类拖入包的文件夹之后,关系就建立了,二元关联符号可以设置为:聚合.合成.接口:空心圆+直线(唐老鸭类实现了‘讲人话’):依赖:虚线+箭头(动物和空气的关系): ...

  10. 崽崽帮www.zaizaibang.com精选3

    [景山远洋美国交换生随笔]异国他乡的感触 [成都亲子活动]可能是成都最全最好的亲子活动了! 黄平-儿科 @体育活动 下雪天乐翻天之穿越封锁线 北京育翔小学的前世今生 武汉儿科类中医口碑榜 南宁周边农家 ...