build boost python 3.4 64 bit - boost

I am trying to follow the tutorial in Boost.python.
My environment is in the title.
When I try the bjam I receive the following error:
C:\local\boost_1_57_0\libs\python\example\tutorial>bjam.exe
address-model=64 ...patience... ...patience... ...found 1894
targets... ...updating 6 targets... msvc.link.dll
bin\msvc-12.0\debug\address-model-64\threading-multi\hello_ext.pyd
Creating library
bin\msvc-12.0\debug\address-model-64\threading-multi\hello_e xt.pdb
and object
bin\msvc-12.0\debug\address-model-64\threading-multi\hello_ext .exp
LINK : fatal error LNK1207: incompatible PDB format in
'C:\local\boost_1_57_0\li
bs\python\example\tutorial\bin\msvc-12.0\debug\address-model-64\threading-multi\
hello_ext.pdb'; delete and rebuild
call "C:\Users\Navid\AppData\Local\Temp\b2_msvc_12.0_vcvarsall_x86_amd64
.cmd" >nul link /NOLOGO /INCREMENTAL:NO /DLL /NOENTRY /DEBUG
/MACHINE:X64 /MANIFEST /subsys tem:console
/out:"bin\msvc-12.0\debug\address-model-64\threading-multi\hello_ext
.pyd"
/IMPLIB:"bin\msvc-12.0\debug\address-model-64\threading-multi\hello_ext.pd
b" /LIBPATH:"C:\Python34\libs"
#"bin\msvc-12.0\debug\address-model-64\threadin
g-multi\hello_ext.pyd.rsp"
if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
...failed msvc.link.dll
bin\msvc-12.0\debug\address-model-64\threading-multi\hel lo_ext.pyd
bin\msvc-12.0\debug\address-model-64\threading-multi\hello_ext.pdb bi
n\msvc-12.0\debug\address-model-64\threading-multi\hello_ext.pdb...
...removing
bin\msvc-12.0\debug\address-model-64\threading-multi\hello_ext.pdb
...skipped hello_ext.pyd for lack of
hello_ext.pyd... copy
bin\hello.test\msvc-12.0\debug\address-model-64\threading-multi\hello.py
hello.py
1 file(s) copied. 2to3 bin\hello.test\msvc-12.0\debug\address-model-64\threading-multi\hello.py
'2to3' is not recognized as an internal or external command, operable
program or batch file. '2to3' is not recognized as an internal or
external command, operable program or batch file.
2to3 -wn --no-diffs "bin\hello.test\msvc-12.0\debug\address-model-64\threadi
ng-multi\hello.py"
2to3 -dwn --no-diffs "bin\hello.test\msvc-12.0\debug\address-model-64\thread
ing-multi\hello.py"
...failed 2to3
bin\hello.test\msvc-12.0\debug\address-model-64\threading-multi\h
ello.py... ...removing
bin\hello.test\msvc-12.0\debug\address-model-64\threading-multi\hell
o.py ...skipped
hel
lo for lack of
hello.py... ...failed updating 3 targets... ...skipped 3 targets...
I made sure .\b2 adress-model=64 and \turorial>bjam address-model=64
The user-config is also configurd for
MSVC configuration.
using msvc : 12.0 ;
Python configuration.
Configure specific Python version. using python : 3.4 : C:\python34 : C:\Python34\include : C:\Python34\libs ;

I want to talk about how to correct the '2to3' is not recognized as an internal or external command, operable program or batch file. It means that 2to3 is not in your path.
In order to add it to your path, follow Python 2to3 windows CMD. Follow the last but one answer

Related

resource.rc: No such file or directory

I'm setting CodeBlocks with wxWidgets, but enountered problems when compile an empty project:
resource.rc: No such file or directory
However, when I creat win32GUI project instead of wxWidgets, I could compile and run an empty GUI.
I installed CodeBlocks 17.12 on the path (D:\GreenSoft\CodeBlocks)
Add the “D:\GreenSoft\CodeBlocks\MinGW\bin” to the path environment variable.
Download the wxWidgets3.1.2 source code to “D:\GreenSoft\wxWidgets\wxWidgets312\”
cd to “D:\GreenSoft\wxWidgets\wxWidgets312\build\msw”, and run command:
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport
After compile finished, I run the OpenBlocks and add a project wxWidget with several options:
wxWidgets 3.1.*
Project Title: App
Prefered GUI builder: wxSmith
Application type: frame-based
wxWidgets location: D:\GreenSoft\wxWidgets\wxWidgets312
Compiler: GUN GCC compiler
Create Debug…
Create Release…
With three wxWidgets Library settings checked only
Then an empty GUI panel appeared in CodeBlocks.
I do nothing but click the compile button, and error appeared:
It says that
gcc: error: D:QMDownloadrmdCsrrresource.rc: No such file or directory
But I checked that the file D:\QMDownload\rmdCs\App\resource.rc exist , and its textcontent is:
aaaa ICON "wx/msw/std.ico"
include "wx/msw/wx.rc"
I have found a post with the same issue and make sure that no blank space and special character exist in all the paths, but the problem still exist.
-------------- Build: Debug in App (compiler: GNU GCC Compiler)---------------
windres.exe -ID:\GreenSoft\wxWidgets\wxWidgets312\include -ID:\GreenSoft\wxWidgets\wxWidgets312\lib\gcc_dll\mswu -J rc -O coff -i D:\QMDownload\rmdCs\App\resource.rc -o obj\Debug\resource.res
x86_64-w64-mingw32-g++.exe -LD:\GreenSoft\wxWidgets\wxWidgets312\lib\gcc_dll -o bin\Debug\App.exe obj\Debug\AppApp.o obj\Debug\AppMain.o obj\Debug\resource.res -mthreads -lwxmsw31u -mwindows
gcc: error: D:QMDownloadrmdCsAppresource.rc: No such file or directory
gcc: warning: '-x c' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
windres: preprocessing failed.
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 1 warning(s) (0 minute(s), 0 second(s))

/bin/sh: cl: command not found usig make within cygwin

I'm working with Intel Pin on a Windows 7 machine. As suggested on Pin user guide, I downloaded Cygwin with the packages I need, such as gcc, g++ and make, but when I try to execute the command "make" in order to build one tool (Insmix in this case, but it is the same with any other Pin tool) I get the following error:
make[1]: Entering directory '/cygdrive/c/Users/IEUser/Downloads/pin-3.2-81205-msvc-windows/source/tools/Insmix'
cl /MT /EHs- /EHa- /wd4530 /DTARGET_WINDOWS /DBIGARRAY_MULTIPLIER=1 /nologo /Gy /Oi- /GR- /GS- /D__PIN__=1 /DPIN_CRT=1 /D_WINDOWS_H_PATH_="" /D__i386__ /DTARGET_IA32 /DHOST_IA32 /I../../../source/include/pin /I../../../source/include/pin/gen -I../../../extras/stlport/include -I../../../extras -I../../../extras/libstdc++/include -I../../../extras/crt/include -I../../../extras/crt -I../../../extras/crt/include/arch-x86 -I../../../extras/crt/include/kernel/uapi -I../../../extras/crt/include/kernel/uapi/asm-x86 /FIinclude/msvc_compat.h /I../../../extras/components/include /I../../../extras/xed-ia32/include/xed /I../../../source/tools/InstLib /O2 /c /Foobj-ia32/insmix.obj insmix.cpp
**/bin/sh: cl: command not found**
make[1]: *** [../../../source/tools/Config/makefile.default.rules:192: obj-ia32/insmix.obj] Error 127
I tried to Google it with no success. Does anyone know how to fix this issue?
Thank you very much for you help
cl is prettymuch a Microsoft tool. Install some Visual Studio version, and you'll have that cl tool somewhere in the bin directory in C:\Program Files\Microsoft Visual Studio\...\bin\ Now you set that directory in the environment Path variable. Voila. That works.

Compile Apache APR on Windows

The end result is I am trying to compile something that requires the APR from Apache on Windows.
Edit: Tried Visual Studio command line tools for VS2013 & VS2014.
Link for SVN checkout shows 404: http://apr.apache.org/anonsvn.txt
so...
From this link http://apr.apache.org/compiling_win32.html I have downloaded the three files. I unzipped them and renames them as the directory structure suggested.
C:\work\apr\
C:\work\apr-iconv\
C:\work\apr-util\
Moved to the apr-util directory and ran the following make command and received the following errors.
Note there is the comment about "Current versions of APR do not need awk..." but the link does not work, does it matter?
Anybody have any luck compiling this, do I need other lib/include/objects?
nmake -f Makefile.win buildall checkall installall clean
Received the following errors:
<clip>
rc.exe /l 0x409 /fo".\Release\libapriconv.res" /i "./include" /i "../apr/include" /d "NDEBUG" /d "API_VERSION_ONLY" .\libapriconv.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17336
Copyright (C) Microsoft Corporation. All rights reserved.
link.exe #C:\Users\JOHNAT~1\AppData\Local\Temp\nm390A.tmp
Creating library .\Release\libapriconv-1.lib and object .\Release\libapriconv-1.exp
if exist .\Release\libapriconv-1.dll.manifest mt.exe -manifest .\Release\libapriconv-1.dll.manifest -outputresource:.\Release\libapriconv-1.dll;2
echo Helper for Post-build step > ".\Release\postbld.dep"
cd ccs
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe" -nologo -f Makefile.win all BUILD_MODE="Win32 Release" BIND_MODE=shared adobe-stdenc.c
Creating library ..\Release\iconv\adobe-stdenc.lib and object ..\Release\iconv\adobe-stdenc.exp
adobe-stdenc.obj : error LNK2011: precompiled object not linked in; image may not run
..\Release\iconv\adobe-stdenc.so : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
It's a little late, but here is how I fixed it.
In the build\modules.mk.win makefile change line 221 from
$(SILENT)link $(ALL_LDFLAGS) $*.obj $(API_LIBS) /out:$# \
To
$(SILENT)link $(ALL_LDFLAGS) $*.obj $(MODRES).obj $(API_LIBS) /out:$# \
The shared library target will now read:
.c{$(OUTPUT_DIR)}.so:
$(SILENT)cl $(ALL_CFLAGS) /Fo$*.obj /Yuiconv.h /c $<
$(SILENT)link $(ALL_LDFLAGS) $*.obj $(MODRES).obj $(API_LIBS) /out:$# \
/base:#"..\build\BaseAddr.ref",$(#F)
$(SILENT)if exist $#.manifest \
$(SILENT)mt -nologo -manifest $#.manifest -outputresource:$#;2 \
& del "$#.manifest"
$(SILENT)del "$*.exp" & del "$*.lib"
Source: https://gist.github.com/mkhon/01a1536b01e0065ae799
From the apache-apr project site under heading:
Developer Studio Workspace/Microsoft Development Environment IDE Build::
Open the apr-util/aprutil.dsw workspace, and choose either aprutil or libaprutil (for static or dynamic libraries) with the Release or Debug build as the Active Project. aprutil.dsw causes all related projects to be built.
Maybe you overlooked this statement : choose either aprutil or libaprutil as the Active Project...
Then build the active project.

Could not locate OIS using CMake and Makefiles

So I'm trying to compile a simple Ogre3D project:
C:\OgreSDK\Projects\Physics> cmake -G "MinGW Makefiles" ./
-- Looking for OGRE...
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Found Ogre Ghadamon (1.9.0)
-- Found OGRE: optimized;C:/OgreSDK/lib/Release/OgreMain.lib;debug;C:/OgreSDK/lib/Debug/OgreMain_d.lib
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;C:/OgreSDK/lib/Release/OgrePaging.lib;debug;C:/OgreSDK/lib/debug/OgrePaging_d.lib
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;C:/OgreSDK/lib/Release/OgreTerrain.lib;debug;C:/OgreSDK/lib/debug/OgreTerrain_d.lib
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;C:/OgreSDK/lib/Release/OgreProperty.lib;debug;C:/OgreSDK/lib/debug/OgreProperty_d.lib
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;C:/OgreSDK/lib/Release/OgreRTShaderSystem.lib;debug;C:/OgreSDK/lib/debug/OgreRTShaderSystem_d.lib
-- Looking for OGRE_Volume...
-- Found OGRE_Volume: optimized;C:/OgreSDK/lib/Release/OgreVolume.lib;debug;C:/OgreSDK/lib/debug/OgreVolume_d.lib
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: optimized;C:/OgreSDK/lib/Release/OgreOverlay.lib;debug;C:/OgreSDK/lib/debug/OgreOverlay_d.lib
-- Looking for OIS...
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Could not locate OIS
CMake Error at C:/OgreSDK/CMake/FindPkgMacros.cmake:120 (message):
Required library OIS not found! Install the library (including dev
packages) and try again. If the library is already installed, set the
missing variables manually in cmake.
Call Stack (most recent call first):
C:/OgreSDK/CMake/FindOIS.cmake:82 (findpkg_finish)
CMakeLists.txt:60 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/OgreSDK/Projects/Physics/CMakeFiles/CMakeOutput.log".
I checked, in the OgreSDK/bin folder I can see a OIS(_d).dll. If I try to setup a var OIS_HOME which point to a folder with dll folder within the ois.dll, it doesn't work either.
EDIT
Here is a gist with all env vars listed https://gist.github.com/vinz243/0eea7dd96db785d6a4e3
EDIT 2
After some attempts I edited the findOIS.cmake like this:
#-------------------------------------------------------------------
# This file is part of the CMake build system for OGRE
# (Object-oriented Graphics Rendering Engine)
# For the latest info, see http://www.ogre3d.org/
#
# The contents of this file are placed in the public domain. Feel
# free to make use of it in any way you like.
#-------------------------------------------------------------------
# - Try to find OIS
# Once done, this will define
#
# OIS_FOUND - system has OIS
# OIS_INCLUDE_DIRS - the OIS include directories
# OIS_LIBRARIES - link these to use OIS
# OIS_BINARY_REL / OIS_BINARY_DBG - DLL names (windows only)
include(FindPkgMacros)
findpkg_begin(OIS)
# Get path, convert backslashes as ${ENV_${var}}
getenv_path(OIS_HOME)
getenv_path(OGRE_SDK)
getenv_path(OGRE_HOME)
getenv_path(OGRE_SOURCE)
getenv_path(OGRE_DEPENDENCIES_DIR)
# construct search paths
# set(OIS_PREFIX_PATH "C:\\OgreSDK\\bin")
# create_search_paths(OIS)
# redo search if prefix path changed
message(STATUS OIS_PREFIX_PATH ": " ${OIS_PREFIX_PATH})
clear_if_changed(OIS_PREFIX_PATH
OIS_LIBRARY_FWK
OIS_LIBRARY_REL
OIS_LIBRARY_DBG
OIS_INCLUDE_DIR
)
set(OIS_LIBRARY_NAMES OIS)
get_debug_names(OIS_LIBRARY_NAMES)
use_pkgconfig(OIS_PKGC OIS)
# For OIS, prefer static library over framework (important when referencing OIS source build)
set(CMAKE_FIND_FRAMEWORK "LAST")
findpkg_framework(OIS)
if (OIS_HOME)
# OIS uses the 'includes' path for its headers in the source release, not 'include'
set(OIS_INC_SEARCH_PATH ${OIS_INC_SEARCH_PATH} ${OIS_HOME}/includes)
endif()
if (APPLE AND OIS_HOME)
# OIS source build on Mac stores libs in a different location
# Also this is for static build
set(OIS_LIB_SEARCH_PATH ${OIS_LIB_SEARCH_PATH} ${OIS_HOME}/Mac/XCode-2.2/build)
endif()
find_path(OIS_INCLUDE_DIR NAMES OIS.h HINTS "C:\\OgreSDK\\include\\OIS" PATH_SUFFIXES OIS)
find_library(OIS_LIBRARY_REL NAMES ${OIS_LIBRARY_NAMES} HINTS "C:\\OgreSDK\\lib\\Release" PATH_SUFFIXES Release RelWithDebInfo MinSizeRel)
find_library(OIS_LIBRARY_DBG NAMES ${OIS_LIBRARY_NAMES_DBG} HINTS "C:\\OgreSDK\\lib\\debug" PATH_SUFFIXES Debug)
make_library_set(OIS_LIBRARY)
if (WIN32)
set(OIS_BIN_SEARCH_PATH "C:\\OgreSDK\\bin")
find_file(OIS_BINARY_REL NAMES "OIS.dll" HINTS ${OIS_BIN_SEARCH_PATH}
PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel)
find_file(OIS_BINARY_DBG NAMES "OIS_d.dll" HINTS ${OIS_BIN_SEARCH_PATH}
PATH_SUFFIXES "" Debug )
endif()
mark_as_advanced(OIS_BINARY_REL OIS_BINARY_DBG)
findpkg_finish(OIS)
# add parent of OIS folder to support OIS/OIS.h
add_parent_dir(OIS_INCLUDE_DIRS OIS_INCLUDE_DIR)
# Reset framework finding
set(CMAKE_FIND_FRAMEWORK "FIRST")
And this is what is defined in CMakeCache.txt:
//Path to a file.
OIS_BINARY_DBG:FILEPATH=C:/OgreSDK/bin/Debug/OIS_d.dll
//Path to a file.
OIS_BINARY_REL:FILEPATH=C:/OgreSDK/bin/Release/OIS.dll
//x
OIS_INCLUDE_DIR:PATH=C:/OgreSDK/include/OIS
//x
OIS_LIBRARY_DBG:FILEPATH=OIS_LIBRARY_DBG-NOTFOUND
//x
EDIT 3
I edited the CMakeCache like this:
OIS_BINARY_DBG:FILEPATH=C:/OgreSDK/bin/Debug/OIS_d.dll
//Path to a file.
OIS_BINARY_REL:FILEPATH=C:/OgreSDK/bin/Release/OIS.dll
//x
OIS_INCLUDE_DIR:PATH=C:/OgreSDK/include/OIS
//x
OIS_LIBRARY_DBG:FILEPATH=C:/OgreSDK/lib/Debug/OIS_d.lib
//x
OIS_LIBRARY_FWK:STRING=NOTFOUND
//x
OIS_LIBRARY_REL:FILEPATH=C:/OgreSDK/lib/Debug/OIS.lib
And when I run make:
λ make
Scanning dependencies of target OgreApp
[ 50%] Building CXX object CMakeFiles/OgreApp.dir/BaseApplication.cpp.obj
[100%] Building CXX object CMakeFiles/OgreApp.dir/TutorialApplication.cpp.obj
make[2]: *** No rule to make target « C:/OgreSDK/lib/Debug/OIS.lib »,required for « dist/bin/OgreApp.exe ». Stop.
make[1]: *** [CMakeFiles/OgreApp.dir/all] Error 2
make: *** [all] Error2
EDIT 4: OK, i managed to run cmake. But this is what I get when bulding VS 2013 and v100 compiler:
2> TutorialApplication.cpp
2> Génération de code en cours...
2>BaseApplication.obj : error LNK2019: external symbol unresolved "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category#system#boost##YAABVerror_category#12#XZ) référencé dans la fonction "void __cdecl boost::system::`dynamic initializer for 'posix_category''(void)" (??__Eposix_category#system#boost##YAXXZ)
2>TutorialApplication.obj : error LNK2001: external symbol unresolved "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category#system#boost##YAABVerror_category#12#XZ)
2>Bas**eApplication.obj : error LNK2019: external symbol unresolved "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category#system#boost##YAABVerror_category#12#XZ) référencé dans la fonction "void __cdecl boost::system::`dynamic initializer for 'native_ecat''(void)" (??__Enative_ecat#system#boost##YAXXZ)
2>TutorialApplication.obj : error LNK2001: external symbol unresolved "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category#system#boost##YAABVerror_category#12#XZ)
2>C:\OgreSDK\Projects\Physics\build_win32\Debug\OgreApp_d.exe : fatal error LNK1120: 2 unresolved externals
========== Régénération globale : 1 a réussi, 1 a échoué, 0 a été ignoré ==========
EDIT 5
I'm building Ogre w/ VS 2013 and Boost. Successfully built OgreDeps and Ogre itself, but when running the SampleDemo.exe, it said that D3DCOMPILER_47.dll was missing, but finally found it in Steam folder. now I'm trying to recompile my project
EDIT #6
I compiled boost and generated the project. I opened it in VS 2013 and built ALL_BUILD successfully!!!! But how do I run it? The button Debug is named Attach... and when I build INSTALL task it gives me this in both debug and release
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: The command "setlocal
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: "C:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmEnd
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmErrorLevel
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: exit /b %1
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmDone
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
4>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :VCEnd" stopped with code 1.
EDIT #7
OK VS 2013 was generating the OgreApp.exe (or OgreApp_d) in dist. Copied every Ogre dll file in this folder and ran the exe and it worked :) Thank you guys for all your help. To conclude, the solution was rebuilding Ogre with the VS version I wanted to use
Why don't you wish to install pkg-config for Windows first? It would save you from a manual hacking of the CMakefile.txt-s.
The last error you've got is due to missing (proper) linker flags for linking Boost.System library. Likely, one or several of the libraries being linked in also require Boost.System, and this dependency isn't resolved automatically. Typically pkg-config is used to handle the dependecies, but since you're doing-it-yourself, you should manually add the library dependency using imported library target. See this tutorial to get the idea how to properly include external pre-existing libraries to the build chain of your project.
Actually the standard way to define required Boost dependencies in CMakeLists.txt looks like this:
find_package(Boost 1.50 COMPONENTS program_options locale REQUIRED)
with the subsequent
include_directories(${Boost_INCLUDE_DIRS})
add_executable(an_executable ${AN_EXE_SOURCES})
target_link_libraries(an_executable
...
${Boost_LIBRARIES}
)
please note that at least some linkers (e.g. GNU ld) can't re-order a given library list, so if your application demand LibA and LibB, and LibB in turn depends on LibA, than LibB should go first in the linkers library list (if both LibA and LibB depend on each other, than one of these libraries should be included twice). I'm not sure that the problem is actual for Microsoft VC++ Linker, but it's worth mentioning.
Upd: #Vinz243 had to rebuild the OGRE library to get it properly linked against the test application.

How to get boost.python tutorial example to link with Python3?

I want to use boost.python with python 3.2+ (preferably 3.4) and Visual Studio 2010.
When I try to make the libs\python\example\tutorial example against any Python3 (I have tested 3.0, 3.2 and 3.4) it doesn't link (see below). When I link it against 2.7 it works.
The only change I make between attempts is updating user-config.jam in my home directory.
So it works when user-config.jam is:
# MSVC configuration
using msvc : 10.0 ;
# Python configuration:
using python : 2.7 : C:\\Python27 : C:\\Python27\\include : C:\\Python27\\libs ;
When I run bjam I get:
C:\Boost\boost_1_55_0\libs\python\example\tutorial>bjam
link.jam: No such file or directory
...patience...
...patience...
...found 1678 targets...
...updating 8 targets...
compile-c-c++ bin\msvc-10.0\debug\hello.obj
hello.cpp
msvc.link.dll bin\msvc-10.0\debug\hello_ext.pyd
Creating library bin\msvc-10.0\debug\hello_ext.lib and object bin\msvc-10.0\debug\hello_ext.exp
msvc.manifest.dll bin\msvc-10.0\debug\hello_ext.pyd
common.copy boost_python-vc100-gd-1_55.dll
..\..\..\..\bin.v2\libs\python\build\msvc-10.0\debug\boost_python-vc100-gd-1_55.dll
1 file(s) copied.
common.copy hello_ext.pyd
bin\msvc-10.0\debug\hello_ext.pyd
1 file(s) copied.
capture-output bin\hello.test\msvc-10.0\debug\hello
1 file(s) copied.
**passed** bin\hello.test\msvc-10.0\debug\hello.test
...updated 8 targets...
If I change user-config.jam to:
# MSVC configuration
using msvc : 10.0 ;
# Python configuration:
using python : 3.4 : C:\\Python34 : C:\\Python34\\include : C:\\Python34\\libs ;
and to bjam clean and then bjam I get:
C:\Boost\boost_1_55_0\libs\python\example\tutorial>bjam
link.jam: No such file or directory
...patience...
...patience...
...found 1685 targets...
...updating 9 targets...
compile-c-c++ bin\msvc-10.0\debug\hello.obj
hello.cpp
msvc.link.dll bin\msvc-10.0\debug\hello_ext.pyd
Creating library bin\msvc-10.0\debug\hello_ext.lib and object bin\msvc-10.0\debug\hello_ext.exp
hello.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) struct _object * __cdecl boost::python::detail::init_module(struct PyModuleDef &,void (__cdecl*)(void))" (__imp_?init_module#detail#python#boost##YAPAU_object##AAUPyModuleDef##P6AXXZ#Z) referenced in function _PyInit_hello_ext
bin\msvc-10.0\debug\hello_ext.pyd : fatal error LNK1120: 1 unresolved externals
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /MACHINE:X86 /MANIFEST /subsystem:console /out:"bin\msvc-10.0\debug\hello_ext.pyd" /IMPLIB:"bin\msvc-10.0\debug\hello_ext.lib" /LIBPATH:"C:\Python34\libs" #"bin\msvc-10.0\debug\hello_ext.pyd.rsp"
if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%
...failed msvc.link.dll bin\msvc-10.0\debug\hello_ext.pyd bin\msvc-10.0\debug\hello_ext.lib bin\msvc-10.0\debug\hello_ext.pdb bin\msvc-10.0\debug\hello_ext.pdb...
...removing bin\msvc-10.0\debug\hello_ext.lib
...removing bin\msvc-10.0\debug\hello_ext.pdb
common.copy boost_python-vc100-gd-1_55.dll
..\..\..\..\bin.v2\libs\python\build\msvc-10.0\debug\boost_python-vc100-gd-1_55.dll
1 file(s) copied.
...skipped <p.>hello_ext.pyd for lack of <pbin\msvc-10.0\debug>hello_ext.pyd...
...failed updating 3 targets...
...skipped 1 target...
...updated 2 targets...
Looking online I find a couple of references to this error but no solutions...
Here is the best link:
http://lists.boost.org/boost-build/2011/06/25147.php
I have seen many people talking about using Python3 and boost.python so I must be missing something... Do I need to compile boost specifically for Python 3 somehow?
Help?
/Robert
So through trial and error I found a way that works.
I am not able to recompile a boost library from Python27 to Python34 but if I start from a clean area (i.e freshly 7zipped) and do the following it works (all in a Visual Studio 2010 command prompt):
Make sure you have a user-config.jam file in your home directory with the following content:
# MSVC configuration
using msvc : 10.0 ;
# Python configuration:
using python : 3.4 : C:\\Python34 : C:\\Python34\\include : C:\\Python34\\libs ;
cd C:\Boost\boost_1_55_0
bootstrap
b2 toolset=msvc-10.0 --build-type=complete --with-python --libdir=C:\Boost\lib\i386 install
cd C:\Boost\boost_1_55_0\libs\python\example\tutorial
set lib=c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib;C:\Boost\lib\i386;C:\Python34\libs (i.e add Boost Lib to path)
bjam
Modify hello.py to att () around print:
import hello_ext
print(hello_ext.greet())
python hello.py prints hello, world (Note that python here is python 3.4.1 my default install)
So what I still don't know how to solve is how to recompile boost and/or how to support two python version at the same time. Ideas and suggestions are welcomed but at the moment I only need Python3 so I will not investigate that.
Another thing to note is that the pre-compiled headers found online all seem to be 2.7 only. I hope these steps helps someone else!

Resources