Posts Tagged ‘build mysql’

How to Build MySQL 5.7 on Windows from Source Code

Tuesday, June 18th, 2013

I just installed 5.7.1 on Windows and next up was to build it from source on Windows, so that’s what I did, and thought I’d share the steps.

** Prerequisites **

1. Install Microsoft Visual Studio (I installed VS 2010 Express – free)
2. Install cmake
3. Install bison (make sure no spaces in path)

** Build Instructions **

cd c:\mysql\mysql-5.7.1
mkdir bld
cd bld
cmake ..
cmake --build . --config relwithdebinfo --target package

And here is the full output for anyone who might be interested:

C:\Windows\system32>cd C:\mysql\mysql-5.7.1

C:\mysql\mysql-5.7.1>mkdir bld

C:\mysql\mysql-5.7.1>cd bld

C:\mysql\mysql-5.7.1\bld>cmake ..
-- Building for: Visual Studio 10
-- Running cmake version 2.8.11.1
-- Configuring with MAX_INDEXES = 64U
-- The C compiler identification is MSVC 16.0.30319.1
-- The CXX compiler identification is MSVC 16.0.30319.1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check size of void *
-- Check size of void * - done
-- MySQL 5.7.1-m11
-- Packaging as: mysql-5.7.1-m11-win32
-- Found Threads: TRUE
-- Looking for ntohll
-- Looking for ntohll - not found
-- Looking for inet_ntop
-- Looking for inet_ntop - not found
-- Check size of time_t
-- Check size of time_t - done
-- Performing Test TIME_T_UNSIGNED
-- Performing Test TIME_T_UNSIGNED - Failed
-- Looking for GetCurrentProcessorNumber
-- Looking for GetCurrentProcessorNumber - not found
-- Using cmake version 2.8.11.1
-- Not building NDB
-- Library mysqlclient depends on OSLIBS ws2_32;Secur32
-- Googlemock was not found. gtest-based unit tests will be disabled.
   You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download
   and build required components from source.
-- If you are inside a firewall, you may need to use an http proxy:
   export http_proxy=http://foo.bar.com:80
-- Library mysqlserver depends on OSLIBS ws2_32
-- mysql-test/include/max_indexes.inc adjusted
-- Cannot find wix 3, installer project will not be generated
-- Configuring done
-- Generating done
-- Build files have been written to: C:/mysql/mysql-5.7.1/bld

C:\mysql\mysql-5.7.1\bld>cmake --build . --config relwithdebinfo --target package
.....
..... tons of output .....
.....

    399 Warning(s)
    0 Error(s)

Time Elapsed 00:17:13.65

C:\mysql\mysql-5.7.1\bld>

Done!!!

mysql-5.7.1-m11-win32.zip created in C:\mysql\mysql-5.7.1\bld

Hope this helps. :)

 

Related Build Links:

 

Building MariaDB 5.1 on Windows Revisited

Tuesday, June 18th, 2013

I previously wrote an article on Building MariaDB 5.1 on Windows, but it was about 1.5 years ago (for 5.1.60; this is for 5.1.67), so I wanted to update this a little since I’ve built it entirely from the command-line this time (as well as highlight a couple problems/solutions – which I’ll cover in a subsequent troubleshooting post). This process it quite similar to my steps for building MariaDB 5.5 and MariaDB 10.0, however it’s slightly different since 5.1 requires you run the configure.js script before running cmake. Aside from that though, things are mostly the same. :)

Here is the full procedure:

Download 5.1.67 MariaDB source and extract to C:\mysql\mariadb-5.1.67
cd C:\mysql\mariadb-5.1.67
win\configure.js
cmake .
cmake --build . --config relwithdebinfo --target package

There you have it. MariaDB-5.1.67-win32.exe is created in the main dir. Also, it, and other related files, can be found in C:\mysql\mariadb-5.1.67\_CPack_Packages\win32\NSIS as well.

And for those interested, here is my [mostly] full output (I’ll spare you the “full” build/compilation outputs):

C:\>cd C:\mysql\mariadb-5.1.67

C:\>cd C:\mysql\mariadb-5.1.67

C:\mysql\mariadb-5.1.67>win\configure.js

C:\mysql\mariadb-5.1.67>cmake .
-- Building for: Visual Studio 10
-- The C compiler identification is MSVC 16.0.30319.1
-- The CXX compiler identification is MSVC 16.0.30319.1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
build CSV as static library (libcsv.lib)
build FEDERATEDX as static library (libfederatedx.lib)
build HEAP as static library (libheap_s.lib)
build MARIA as static library (libmaria_s.lib)
build MYISAM as static library (libmyisam_s.lib)
build MYISAMMRG as static library (libmyisammrg_s.lib)
build PBXT as static library (libpbxt_s.lib)
build XTRADB as static library (libxtradb.lib)
build ARCHIVE as DLL (ha_archive.dll)
build BLACKHOLE as DLL (ha_blackhole.dll)
build EXAMPLE as DLL (ha_example.dll)
build FEDERATED as DLL (ha_federated.dll)
build INNODB_PLUGIN as DLL (ha_innodb_plugin.dll)
CMake Warning at C:/Program Files (x86)/cmake/share/cmake-2.8/Modules/
InstallRequiredSystemLibraries.cmake:343 (message):
  system runtime library file does not exist:
  'MSVC10_REDIST_DIR-NOTFOUND/x86/Microsoft.VC100.CRT/msvcp100.dll'
Call Stack (most recent call first):
  CMakeLists.txt:562 (INCLUDE)

CMake Warning at C:/Program Files (x86)/cmake/share/cmake-2.8/Modules/
InstallRequiredSystemLibraries.cmake:343 (message):
  system runtime library file does not exist:
  'MSVC10_REDIST_DIR-NOTFOUND/x86/Microsoft.VC100.CRT/msvcr100.dll'
Call Stack (most recent call first):
  CMakeLists.txt:562 (INCLUDE)

-- Configuring done
-- Generating done
-- Build files have been written to: C:/mysql/mariadb-5.1.67

C:\mysql\mariadb-5.1.67>cmake --build . --config relwithdebinfo --target package
......
...... tons of output ......
......
PostBuildEvent:
  ...
  CPack: Create package using NSIS
  CPack: Install projects
  CPack: - Install project: MySql
  CPack: -   Install component: Unspecified
  CPack: -   Install component: headers
  CPack: -   Install component: mysqltest
  CPack: -   Install component: runtime
  CPack: -   Install component: scripts
  CPack: -   Install component: sqlbench
  CPack: Create package
  CPack: - package: C:/mysql/mariadb-5.1.67/MariaDB-5.1.67-win32.exe generated.
FinalizeBuildStatus:
  Deleting file "Win32\relwithdebinfo\PACKAGE\PACKAGE.unsuccessfulbuild".
  Touching "Win32\relwithdebinfo\PACKAGE\PACKAGE.lastbuildstate".
Done Building Project "C:\mysql\mariadb-5.1.67\package.vcxproj" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:13:53.66

Hope this helps. :)

 

 

Building MySQL and MariaDB on Windows using Visual Studio 2012 Express versus Visual Studio 2010 Express

Friday, April 5th, 2013

I mentioned in a recent post (and another recent, related post) I was going to try Visual Studio 2012 Express (as opposed to VS 2010 Express) for building MySQL 5.6 and MariaDB 10.0. on Windows.

I followed the exact same steps, but MySQL 5.6.10 would not build without fatal errors in 2012 (whereas it worked fine with VS 2010). Unfortunately, the fail errors were not too descriptive, so not quite sure what to do yet to fix it. Here is a brief snippet for those interested:

...
Done Building Project "C:\...\bld\sql\udf_example.vcxproj" (default targets).
Done Building Project "C:\...\bld\ALL_BUILD.vcxproj" (default targets) -- FAILED.
Done Building Project "c:\...\bld\package.vcxproj" (default targets) -- FAILED.
...
Build FAILED.
...

"c:\mysql\mysql-5.6.10\bld\package.vcxproj" (default target) (1) ->
"C:\mysql\mysql-5.6.10\bld\ALL_BUILD.vcxproj" (default target) (2) ->
"C:\mysql\mysql-5.6.10\bld\plugin\audit_null\audit_null.vcxproj" (default target) (18) ->
"C:\mysql\mysql-5.6.10\bld\sql\mysqld.vcxproj" (default target) (19) ->
(Link target) ->
  mysqld.exp : error LNK2001: unresolved external symbol
  _xmm@7fffffffffffffff7fffffffffffffff [C:\mysql\mysql-5.6.10\bld\sql\mysqld.vcxproj]
  C:\mysql\mysql-5.6.10\bld\sql\RelWithDebInfo\mysqld.exe : fatal error LNK1120:
  1 unresolved externals [C:\mysql\mysql-5.6.10\bld\sql\mysqld.vcxproj]

    6 Warning(s)
    2 Error(s)

Time Elapsed 00:01:06.67

On the plus side, MariaDB 10.0.1 compiled just fine with both Visual Studio 2012 Express and Visual Studio 2010 Express! So I was really happy about that. :)

I thought I could just keep both VSs installed, but they don’t seem to want to play nice, even when specifying the following for the MySQL 5.6 build (perhaps that’s just me though):

cmake .. -G "Visual Studio 10"

So, if you are building your own on Windows, then you may want to keep the above in mind (my tests have been on Windows 7 64-bit, fwiw).

I’ll continue to test, and post anything useful if there’s something worth mentioning.

 

 

How to Build MySQL 5.6 on Windows from Source Code

Thursday, March 28th, 2013

I just set up a new Windows 7 machine, and built MySQL 5.6 for the first time, so I wanted to share my steps for anyone interested.

** Prerequisites **
1. Install Microsoft Visual Studio (I installed VS 2010 Express – free)
2. Install cmake
3. Install bison (make sure no spaces in path)

** Build Instructions **

cd c:\mysql\mysql-5.6.10
mkdir bld
cd bld
cmake ..
cmake --build . --config relwithdebinfo --target package

(You don’t technically need the ‘bld’ dir, but I prefer it to keep the main dir ‘clean’. Then if you need to re-build, you can quickly just delete the whole ‘bld’ directory, and start fresh.)

Here is my actual output for those interested:

c:\>cd c:\mysql\mysql-5.6.10
c:\mysql\mysql-5.6.10>mkdir bld
c:\mysql\mysql-5.6.10>cd bld
c:\mysql\mysql-5.6.10\bld>cmake ..
-- Building for: Visual Studio 10
-- Running cmake version 2.8.10.2
-- The C compiler identification is MSVC 16.0.30319.1
-- The CXX compiler identification is MSVC 16.0.30319.1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check size of void *
-- Check size of void * - done
-- MySQL 5.6.10
-- Packaging as: mysql-5.6.10-win32
-- Looking for include file sasl/sasl.h
-- Looking for include file sasl/sasl.h - not found
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - not found
-- Looking for include file signal.h
-- Looking for include file signal.h - found
-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - not found
-- Looking for include file sys/epoll.h
-- Looking for include file sys/epoll.h - not found
-- Looking for include file sys/event.h
-- Looking for include file sys/event.h - not found
-- Looking for include file sys/queue.h
-- Looking for include file sys/queue.h - not found
-- Looking for TAILQ_FOREACH
-- Looking for TAILQ_FOREACH - not found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found
-- Found Threads: TRUE
-- Looking for _aligned_malloc
-- Looking for _aligned_malloc - found
-- Looking for _aligned_free
-- Looking for _aligned_free - found
-- Looking for fedisableexcept
-- Looking for fedisableexcept - not found
-- Looking for posix_memalign
-- Looking for posix_memalign - not found
-- Looking for ntohll
-- Looking for ntohll - not found
-- Looking for clock_gettime
-- Looking for clock_gettime - not found
-- Looking for epoll_create
-- Looking for epoll_create - not found
-- Looking for epoll_ctl
-- Looking for epoll_ctl - not found
-- Looking for inet_ntop
-- Looking for inet_ntop - not found
-- Looking for kqueue
-- Looking for kqueue - not found
-- Looking for kqueue
-- Looking for kqueue - not found
-- Looking for signal
-- Looking for signal - found
-- Looking for timeradd
-- Looking for timeradd - not found
-- Looking for timerclear
-- Looking for timerclear - not found
-- Looking for timercmp
-- Looking for timercmp - not found
-- Looking for timerisset
-- Looking for timerisset - not found
-- Check size of time_t
-- Check size of time_t - done
-- Performing Test TIME_T_UNSIGNED
-- Performing Test TIME_T_UNSIGNED - Failed
-- Looking for sched_getcpu
-- Looking for sched_getcpu - not found
-- Looking for asprintf
-- Looking for asprintf - not found
-- Using cmake version 2.8.10.2
-- Not building NDB
-- Googlemock was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://foo.bar.com:80
-- Cannot find wix 3, installer project will not be generated
-- Configuring done
-- Generating done
-- Build files have been written to: C:/mysql/mysql-5.6.10

c:\mysql\mysql-5.6.10\bld>cmake --build . --config relwithdebinfo --target package
...
... tons of build/compilation output ...
...
    406 Warning(s)
    0 Error(s)

Time Elapsed 00:16:46.65

There you go!

The zip package (mysql-5.6.10-win32.zip in this case) will be located in bld/.

I will say that is a lot of warnings, though I’m fairly used to them on Windows. However, I plan to try VS 2012 Express to see if that makes any difference.

Hope this helps. :)

 

How to Build MariaDB 10.0 on Windows from Source Code

Tuesday, March 26th, 2013

I just wanted to share my steps for building MariaDB 10.0 on Windows (10.0.1 in this case):

cd maria-10.0.1
mkdir bld
cd bld
cmake .. -G "Visual Studio 10"
cmake --build . --config relwithdebinfo --target package

That’s it! The zip file is created right there in bld/.

Hope this helps. :)

 

How to Build MariaDB 5.5 on Windows from Source Code

Friday, May 25th, 2012

I built MariaDB 5.5.24 on Windows yesterday from source, so I just wanted to share my steps.

Here is the short version:

bzr branch lp:maria/5.5 maria-5.5
cd maria-5.5
mkdir bld
cd bld
cmake .. -G "Visual Studio 10"
cmake --build . --config relwithdebinfo --target package

Done! Nice, neat zip file is created right there.

Here is the longer version with outputs for those interested:

C:\mariadb-5.5>bzr branch lp:maria/5.5 maria-5.5
Connected (version 2.0, client Twisted)
Authentication (publickey) successful!
Secsh channel 1 opened.
Branched 3418 revision(s).

C:\mariadb-5.5>cd maria-5.5

C:\mariadb-5.5\maria-5.5>mkdir bld

C:\mariadb-5.5\maria-5.5>cd bld

C:\mariadb-5.5\maria-5.5\bld>cmake .. -G "Visual Studio 10"
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10
-- Check for working CXX compiler using: Visual Studio 10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- MariaDB 5.5.24
-- Check size of void *
-- Check size of void * - done
-- Packaging as: mariadb-5.5.24-win32
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - not found.
-- Found Threads: TRUE
-- Looking for pthread_attr_getguardsize
-- Looking for pthread_attr_getguardsize - not found
-- Check size of time_t
-- Check size of time_t - done
-- Could NOT find Boost
-- Cannot find wix 3, installer project will not be generated
-- Looking for MFC
-- Looking for MFC - not found
-- Configuring done
-- Generating done
-- Build files have been written to: C:/mariadb-5.5/maria-5.5/bld

C:\mariadb-5.5\maria-5.5\bld>cmake --build . --config relwithdebinfo --target package
.......
lots of output
.......
C:\mariadb-5.5\maria-5.5\bld\...
C:\mariadb-5.5\maria-5.5\bld\...
C:\mariadb-5.5\maria-5.5\bld\...

    46 Warning(s)
    0 Error(s)

Time Elapsed 00:23:18.16

Success \o/

Package is named: mariadb-5.5.24-win32.zip

Full location:

C:\mariadb-5.5\maria-5.5\bld\mariadb-5.5.24-win32.zip

C:\Users\Chris>mysql -uroot -pmysql -P3313 -e"select version()"
+----------------+
| version()      |
+----------------+
| 5.5.24-MariaDB |
+----------------+

With XtraDB+ (i.e., InnoDB plugin is not enabled), it starts fine, and uses InnoDB version 1.1.8-24.1.

If you try to enable the original InnoDB plugin, note the library is now named ha_innodb.dll (or ha_innodb.so) instead of ha_innodb_plugin.dll (or ha_innodb_plugin.so), which is what it was named in MySQL/MariaDB 5.1. I discuss this topic in more detail here, if you’re interested.

Hope this helps.

Further resources:

Full Details on CMake here:

http://forge.mysql.com/wiki/CMake

For details on building on Linux, please see here:

http://kb.askmonty.org/en/source-building-mariadb-on-centos/
..
 

Building MariaDB 5.3 on Windows

Friday, February 10th, 2012

I just wanted to share my steps for building MariaDB 5.3 on Windows. (Note, this is not much different than the instructions Wlad posted here).

But, things are not always so smooth, and of course I ran into a couple small issues, so I wanted to share my outputs plus those issues and their solutions (once again many thanks go to Wlad!) for those out there who might encounter the same.

Here are the steps to build:

  1. Download MariaDB 5.3 and extracted to C:\mariadb-5.3
  2. cd C:\mariadb-5.3
  3. mkdir bld
  4. cd bld
  5. cmake .. -G "Visual Studio 9 2008"
  6. cmake --build . --config relwithdebinfo --target package

* By making a sub-dir named ‘bld’ and cd’ing into it, you’ll keep all of your build files in their own dir. This way, it is easy to start over (just delete /bld/) and it also keeps your sourcedir clean and looking like it does originally.

** The last command is the build command issued from the command line. You could accomplish the same with the following commands from within Visual Studio:

VS2008: File -> Open -> Solution -> C:\mariadb-5.3\bld\MySql.sln
VS2008: Build -> Build Solution
VS2008: Right-click "PACKAGE" -> Build

..

Outputs:

C:\Users\Chris>cd C:\mariadb-5.3

C:\mariadb-5.3>mkdir bld

C:\mariadb-5.3>cd bld

C:\mariadb-5.3\bld>cmake ..
-- Building for: Visual Studio 8 2005
-- Check for working C compiler using: Visual Studio 8 2005
-- Check for working C compiler using: Visual Studio 8 2005 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 8 2005
-- Check for working CXX compiler using: Visual Studio 8 2005 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - not found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void *
-- Check size of void * - done
-- Using Aria for temporary tables
build ARCHIVE as static library (libarchive.lib)
build BLACKHOLE as static library (libblackhole.lib)
build CSV as static library (libcsv.lib)
build FEDERATEDX as static library (libfederatedx.lib)
build HEAP as static library (libheap_s.lib)
build ARIA as static library (libaria_s.lib)
build MYISAM as static library (libmyisam_s.lib)
build MYISAMMRG as static library (libmyisammrg_s.lib)
build PBXT as static library (libpbxt_s.lib)
build XTRADB as static library (libxtradb.lib)
build FEEDBACK as static library (libfeedback.lib)
build EXAMPLE as DLL (ha_example.dll)
build FEDERATED as DLL (ha_federated.dll)
build INNODB_PLUGIN as DLL (ha_innodb_plugin.dll)
-- Could NOT find Boost
-- Performing Test BOOST_OK
-- Performing Test BOOST_OK - Failed
build SPHINX as DLL (ha_sphinx.dll)
-- Looking for MFC
-- Looking for MFC - found
-- Cannot find wix 3, installer project will not be generated
-- Configuring done
-- Generating done
-- Build files have been written to: C:/mariadb-5.3/bld

I first compiled from within Visual Studio (alternate step #6), and here is the last line of that output:

========== Build: 84 succeeded, 1 failed, 2 up-to-date, 6 skipped ==========

(More on the 1 error below – but it’s safe to ignore.)

And here is the output from the command line compilation (since I did this second, there was not nearly the output, so I ‘ll post it all):

C:\mariadb-5.3\bld>cmake --build . --config relwithdebinfo --target package

Microsoft (R) Visual C++ Express Edition Version 9.0.30729.1.
Copyright (C) Microsoft Corp 2007. All rights reserved.
1>------ Build started: Project: PACKAGE, Configuration: RelWithDebInfo Win32 ------
1>
1>Performing Post-Build Event...
1>CPack: Create package using ZIP
1>CPack: Install projects
1>CPack: - Install project: MySql
1>CPack: Create package
1>CPack: - package: C:/mariadb-5.3/bld/mariadb-5.3.3-win32.zip generated.
1>Build log was saved at "file://c:\mariadb-5.3\bld\PACKAGE.dir\RelWithDebInfo\BuildLog.htm"
1>PACKAGE - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 86 up-to-date, 0 skipped ==========

..

Error Appendix:

CMake – Cannot find source file “cmake_dummy.cc”:

cmake ..
...
Cannot find source file "cmake_dummy.cc"

Solution:

Upgrading CMake from 2.6 (2.6.4) to 2.8 (2.8.7) worked and eliminated this error. You can download it from here.

..

CMake – General Comment:

If you have previously installed Visual Studio 2005 and now have installed Visual Studio 2008 (or 2008 and 2010, or some other mix), it is probably best to specify the Generator when invoking cmake. I was getting various strange errors when I did not specify the generator of the Visual Studio I use to compile. Specifically, my cmake was using the VS2005 generator, but I was building with VS2008. So, I had to perform a conversion when opening the solution in VS, not to mention some other starange issues were occurring (saying I passed MFC test, but I was using VS2008 Express, so I did not have the proper MFC for VS2008). Similarly, cmake using relwithdebinfo failed too.

Solution:

Instead of using:

cmake ..

Use:

cmake .. -G "Visual Studio 9 2008"

If you’re not sure what string to use for -G, simply run “cmake” from the command line, with no arguments, and it will display the various available options. For instance:

C:\>cmake
cmake version 2.8.7
...
Generators
The following generators are available on this platform:
  Visual Studio 10            = Generates Visual Studio 10 project files.
  Visual Studio 11            = Generates Visual Studio 11 project files.
  Visual Studio 8 2005        = Generates Visual Studio .NET 2005 project
  Visual Studio 9 2008        = Generates Visual Studio 9 2008 project files.

..

Build – afxwin.h missing error – mysql_upgrade_wizard error:

VS2008 Build ..
...
11>Build log was saved at "file://c:\mariadb-5.3\bld\win\upgrade_wizard\
11>mysql_upgrade_wizard.dir\Debug\BuildLog.htm"
11>mysql_upgrade_wizard - 1 error(s), 0 warning(s)
..
c:\mariadb-5.3\win\upgrade_wizard\stdafx.h(23) : fatal error C1083:
Cannot open include file: 'afxwin.h': No such file or directory

Solution:

Since this is just the mysql_upgrade_wizard, this can be ignored unless you specifically need this.

Otherwise, locate ‘afxwin.h’ and store it to the correct location.

Note that you’re likely receiving this if you using the Visual Studio Express Edition, as ‘afxwin.h’ is not available in the Express Edition, as described on the following pages:

http://stackoverflow.com/questions/5543523/afxwin-h-file-is-missing-in-vc-express-edition
http://social.msdn.microsoft.com/forums/en-US/Vsexpressvc/thread/7c274008-80eb-42a0-a79b-95f5afbf6528/

..

Other common build errors and their solutions can be found here.

..
 

How to Build MySQL 5.5 from Source Code on Windows

Tuesday, January 17th, 2012

Not counting obtaining the source code, and once you have the prerequisites satisfied, [Windows] users can build from source code in 5 easy steps.

Prerequisites – Install & ensure they are in the $PATH:

  1. CMake <-- Download
  2. C++ compiler <-- Visual Studio 2008 Express - Free Download
  3. Bison <-- Download (ensure m4.exe is also included, which it should be)

Optional (but most likely you’ll want):

  1. Perl <-- For Test Suite/Scripts. Strawberry Perl is a great option.
  2. Bazaar <-- If want latest source tree

Tip: Install these in locations where spaces are not in the path. Specifically, watch for the Bison/m4 as there is a known bug with regards to that.

..

Now that that’s out of the way, we can begin. You just need to decide if you want to build from source code you download or from the latest development tree.

This will walk through building from the latest development tree (since the downloaded version requires no extra steps – just grab it from any mirror).

Also, this post assumes you can connect to the Launchpad repository via Bazaar and download the source (i.e., you’ll have to create SSH keys to connect to Launchpad – see this write-up for more details. You might also need Pageant too, if you don’t already have it.)

I. Prerequisite Checks:

C:\>cmake --version
cmake version 2.6-patch 4

C:\>bison --version
bison (GNU Bison) 2.4.1

C:\>m4 --version
m4 (GNU M4) 1.4.13

C:\>perl --version
This is perl 5, version 12, subversion 3

C:\>bzr --version
Bazaar (bzr) 2.4.1

..

II. Obtain Source Code (skip this if you download the source directly from a mirror):

  1. Open Pageant -> Add Key -> Select your SSH Key (for Launchpad)
  2. cd C:\
  3. bzr init-repo –trees mysql-5.5
  4. cd mysql-5.5
  5. bzr branch lp:mysql-server/5.5 mysql-5.5

..

III. Build/Compile Source Code:

  1. cd mysql-5.5
  2. cmake . -DBUILD_CONFIG=mysql_release -G “Visual Studio 9 2008″
  3. Copy m4.exe to $basedir/sql <-- this avoids any m4.exe errors (or fix this permanently if this affects you)
  4. Open Solution in VS: File -> Open -> Project/Solution -> C:\mysql-5.5\mysql-5.5\MySQL.sln
  5. Now build in VS: Build -> Build Solution (or F7)
========== Build: 93 succeeded, 0 failed, 5 up-to-date, 10 skipped ==========

There you have it! (Assuming you have “0 failed”, otherwise, you’ve got some debugging to do.)

..

For those interested, I have full outputs, and common errors (with their solutions) from the entire process here:

MySQL 5.5 Windows Build Appendix : Full Outputs and Common Errors from Building MySQL 5.5 on Windows

..

Build Notes (step #2 above):

The -DBUILD_CONFIG=mysql_release flag uses the same build options used for official releases, which are stored in cmake/build_configurations/mysql_release.cmake.

The simplest you could use is: cmake . -G “Visual Studio 9 2008″

Or you could specify a number of options: cmake . -DMYSQL_SERVER_SUFFIX=-chris -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 -DWITHOUT_BLACKHOLE_STORAGE_ENGINE=1 -G “Visual Studio 9 2008″

The -G lets know which compiler will be used. In this case, I’m using VS 2008 Express. If you were using VS 2005, it’d be “Visual Studio 8 2005″, but I’m not sure if VS 2005 will even work.

This command should end with something like “– Build files have been written to: C:/…” or you’ll need to debug.

Lastly, the cmake command creates the MySQL.sln file and all .vcproj files.

..

IV. Kicking the tires …

Creating a “package” in Visual Studio is quite simple:

In the “Solution Explorer” view (far right-hand side of page), right-click on “PACKAGE” -> then “Build”.

If you have problems with this, it can be pieced together easily enough:

  1. Make main dir mysql-5.5.xx
  2. Make subdir bin/ - copy in all .exe files (from client/debug, sql/debug, */debug, etc.)*
  3. Make subdir data/ - copy from sql/data/
  4. Make subdir scripts/ – copy from scripts/ (at least all perl, sql, and sh scripts)
  5. Make subdir share/ - copy from sql/share/
  6. Create my.ini

* Notes re: .exe files: mysqld.exe is located in /sql/debug/ and mysql.exe is located in /client/debug/. The remaining .exe files are located in /client/debug/, /sql/debug/, /extra/debug/, /libmysql/debug/, /mysys/debug/, /scripts/debug/, /storage/myisam/debug/, /storage/heap/debug/, and /tests/debug/.

Now start mysqld:

mysql> select version();
+------------------+
| version()        |
+------------------+
| 5.5.21-debug-log |
+------------------+

Of course you should test it a bit more than that, but I’ll leave that to you.
 
 
..

 
 


Period Panties by Period Panteez Menstrual Underwear Menstruation PMS Panty