Nicky HFE
Nicky HFE

Reputation: 143

Building Boost 1.65.0 with minGW 4.9.2

Background

Planning to use some tools offered by Boost for file system traversing & picking up relevant file names. (May extend to other capabilities provided by Boost if required).

IDE used : Codeblocks 16.0.1
Compiler : minGW 4.9.2 (Comes with standard installation of the IDE above)
OS          : Version 10.0.15063

What I've done so far

  1. Setting minGW to SysPath
  2. Download and extract boost_1_65_0 to C:\User\user\Documents\boost_1_65_0
  3. Using CMD to invoke the bootstrap with gcc toolset via
    bootstrap.bat gcc
    (encountered error-01)
  4. Use the alternative provided by Boost to download prebuild binaries of Boost-Jam.
  5. Downloaded and built the Boost-Jam resulting the creation of bin.ntx86 directory in the directory of Boost Jam (version 3.1.18) via the command
    build.bat gcc
  6. Added the directory of ..\boost-jam-3.1.18\bin.ntx86 to SysPath
  7. Try to build boost again via the command
    bjam --toolset=gcc "--prefix=D:\SoftwareDevelopmentTools\CodeBlocks" install
    (encountered error-02 & warning-01)

    Note: Item 7 is based on the instruction given at Codeblocks BoostWindowsQuickRef

Errors Encountered

Error-01 :

Building Boost.Build engine
C:\Users\user\AppData\Local\Temp\ccayvfUp.o:execnt.c:(.text+0x1237): undefined reference to UnregisterWait
C:\Users\user\AppData\Local\Temp\ccayvfUp.o:execnt.c:(.text+0x12fe): undefined reference to RegisterWaitForSingleObject
collect2.exe: error: ld returned 1 exit status

Output on bootstrap.log

###
### Using 'gcc' toolset.
###

C:\Users\user\Documents\boost_1_65_0\tools\build\src\engine>if exist bootstrap rd /S /Q bootstrap

C:\Users\user\Documents\boost_1_65_0\tools\build\src\engine>md bootstrap

C:\Users\user\Documents\boost_1_65_0\tools\build\src\engine>gcc -DNT -o bootstrap\jam0.exe command.c compile.c constants.c debug.c execcmd.c execnt.c filent.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathnt.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c class.c cwd.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c

C:\Users\user\Documents\boost_1_65_0\tools\build\src\engine>exit /b 1



Error-02 :
Do note that this is on the output after warning-01 (see below under Warning Encountered)

'python' is not recognized as an internal or external command, operable program or batch file.
C:/Users/user/Documents/boost_1_65_0/tools/build/src/tools\python.jam:669: in declare-libpython-target

*** argument error
* rule split-version ( version )
* called with: ( )
* missing argument version

C:/Users/user/Documents/boost_1_65_0/tools/build/src/tools\python.jam:383:see definition of rule 'split-version' being called

C:/Users/user/Documents/boost_1_65_0/tools/build/src/tools\python.jam:971: in configure

C:/Users/user/Documents/boost_1_65_0/tools/build/src/tools\python.jam:115: in python.init

C:/Users/user/Documents/boost_1_65_0/tools/build/src/build\toolset.jam:42: in using libs\python\build\Jamfile:17: in modules.load

C:/Users/user/Documents/boost_1_65_0/tools/build/src/build\project.jam:325: in load-jamfile

C:/Users/user/Documents/boost_1_65_0/tools/build/src/build\project.jam:64: in load

C:/Users/user/Documents/boost_1_65_0/tools/build/src/build\project.jam:89: in load-used-projects

C:/Users/user/Documents/boost_1_65_0/tools/build/src/build\project.jam:75: in load

C:/Users/user/Documents/boost_1_65_0/tools/build/src/build\project.jam:145: in project.find

C:/Users/user/Documents/boost_1_65_0/tools/build/src\build-system.jam:535: in load

C:\Users\user\Documents\boost_1_65_0\tools\build\src/kernel\modules.jam:295: in import

C:\Users\user\Documents\boost_1_65_0\tools\build\src\kernel\bootstrap.jam:139: in boost-build

C:\Users\user\Documents\boost_1_65_0\boost-build.jam:17: in module scope



Warning Encountered

Warning-01 :

warning: mismatched versions of Boost.Build engine and core
warning: Boost.Build engine (bjam) is 03.1.18
warning: Boost.Build core (at C:/Users/user/Documents/boost_1_65_0/tools/build/src) is 2015.07-git



I am thoroughly confused as to what I've done wrong or steps I might have missed. This is the 6th time I've ever tried to build boost

Update 01

Installed Python 3.6 and restart the build with this command bjam --toolset=gcc "--prefix=D:\SoftwareDevelopmentTools\CodeBlocks" install

Encountered this error

C:/Users/user/Documents/boost_1_65_0/tools/build/src/util\path.jam:458: in path.makedirs rule MAKEDIR unknown in module path.
C:/Users/user/Documents/boost_1_65_0/tools/build/src/build\configure.jam:279: in configure.set-log-file
C:/Users/user/Documents/boost_1_65_0/tools/build/src\build-system.jam:679: in load
C:\Users\user\Documents\boost_1_65_0\tools\build\src/kernel\modules.jam:295: in import
C:\Users\user\Documents\boost_1_65_0\tools\build\src\kernel\bootstrap.jam:139: in boost-build
C:\Users\user\Documents\boost_1_65_0\boost-build.jam:17: in module scope

Upvotes: 1

Views: 2000

Answers (2)

Max
Max

Reputation: 11

Try change WINVER to 0x0500 (like on Windows XP). The simplest way - edit strings in file %CodeBlocks%\MinGW\include\windef.h:

#ifndef WINVER
#define WINVER 0x0400

to

#ifndef WINVER
//#define WINVER 0x0400
#define WINVER 0x0500

That must solve your problem.

PS: %CodeBlocks% - Dir in that CodeBlocks was installed.

Upvotes: 1

Nicky HFE
Nicky HFE

Reputation: 143

SOLVED

Most probable cause : Boost.Build for Boost v1.65.0 is not compilable with GCC 4.9.2.

Changed the toolset gcc with a much more recent GCC v6.3.0 (got via minGW-get)

Upvotes: 2

Related Questions