Error in msvc in building inheritance.obj to build hello.pyd
Hello,
I am trying to build the boost 1.31.0 sample extension hello.cpp.
I can not compile the file inheritance.cpp because the two
files containing some templates: adjacency_list. hpp and mem_fn.hpp can
not compile.
Does anyone have any solutions?
Instead of Visual C++ 6.0 should I use a different compiler?
Anyone have any success on any other compiler?
Did anyone manage to build a hello.pyd?
Thank you very much.
Here is my script below (with embedded results).
rem I have MSVC 6.0 Service Pack 5 on Windows 2000 Service Pack 3
default installs on F:
rem Python is located in F:\Python23
rem Boost is located in W:\boost_1_31_0
rem MSVC stlPort 4.6.2 installed, compiled and
rem VC studio include dirs and libraries dirs configured to use it.
rem build boost.jam (so I have a bjam.exe for all below)
W:
vcvars32.bat
cd W:\boost_1_31_0 \tools\build\ja m_src
rem below since I have multilple toolsets installed I will always be
specific.
..\build.bat msvc
rem result: 2 minutes later: NO WARN NO ERRORS
dir W:\boost_1_31_0 \tools\build\ja m_src\bin.ntx86 \*
rem result: OK I have *jam*.exe executables: bjam.exe jam.exe
mkjambase.exe yyacc.exe
rem build boost (using boost.jam (bjam from above))
W:
vcvars32.bat
set PYTHON_ROOT=F:\ Python23
set PYTHON_VERSION= 2.3
set PATH=%PATH%;W:\ boost_1_31_0\to ols\build\jam_s rc\bin.ntx86
rem APPEND THE BJAM PATH ABOVE TO THE SYSTEM ENVRONMENT VARIABLE PATH
cd W:\boost_1_31_0
rem below since I have multilple toolsets installed I will always be
specific.
bjam "-sTOOLS=msvc" install
rem about 90 minutes later ERROR RESULTS FOLLOW:
<<< errors.txt contents below >>>
cl /Zm800 -nologo -GX -c -DNDEBUG -DNDEBUG -DBOOST_PYTHON_D YNAMIC_LIB
-DBOOST_PYTHON_S OURCE /Ogity /O2 /Gs /Ob2 /GX /GR /MD
-I"bin\boost\lib s\python\build" -I"W:\boost_1_31 _0"
-I"F:\Python23\i nclude" -I"F:\Program Files\Microsoft Visual
Studio\VC98\Inc lude"
-Fo"bin\boost\li bs\python\build \boost_python.d ll\msvc\release \inheritance.ob j"
-Tp"W:\boost_1_3 1_0\libs\python \build\../src/object/inheritance.cpp "
rem error below results below ...
F:\Program Files\Microsoft Visual Studio\VC98\Bin >cl /Zm800 -nologo
-GX -c -DNDEBUG -DNDEBUG -DBOOST_PYTHON_D YNAMIC_LIB
-DBOOST_PYTHON_S OURCE /Ogity /O2 /Gs /Ob2 /GX /GR /MD
-I"bin\boost\lib s\python\build" -I"W:\boost_1_31 _0"
-I"F:\Python23\i nclude"
-I"F:\Program Files\Microsoft Visual Studio\VC98\Inc lude"
-Fo"bin\boost\li bs\python\build \boost_python.d ll\msvc\release \inheritance.ob j"
-Tp"W:\boost_1_3 1_0\libs\python \build\../src/object/inheritance.cpp "
inheritance.cpp
W:\boost_1_31_0 \boost/graph/detail/adjacency_list. hpp(1055) : error
C2244: 'bidirectional_ graph_helper_wi th_property<Con fig>::remove_ed ge'
: unable to resolve function overload
W:\boost_1_31_0 \boost/graph/detail/adjacency_list. hpp(1057) : error
C2954: template definitions cannot nest
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2039: 'dm' : is not a
member of '_mfi'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2143: syntax error :
missing ';' before '<'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2501: 'dm' : missing
storage-class or type specifiers
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2059: syntax error : ';'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2059: syntax error : '<'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2653: 'T' : is not a
class or namespace name
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2645: no qualified name
for pointer to member (found ':: *')
W:\boost_1_31_0 \boost/mem_fn.hpp(320) : error C2143: syntax error :
missing ';' before '}'
W:\boost_1_31_0 \boost/mem_fn.hpp(320) : fatal error C1506:
unrecoverable block scoping error
F:\Program Files\Microsoft Visual Studio\VC98\Bin >
W:\boost_1_31_0 \boost/graph/detail/adjacency_list. hpp(1055) : error
C2244: 'bidirectional_ graph_helper_wi th_property<Con fig>::remove_ed ge'
: unable to resolve function overload
W:\boost_1_31_0 \boost/graph/detail/adjacency_list. hpp(1057) : error
C2954: template definitions cannot nest
rem the problem area in adjacency_list. hpp is here ...
template <class Config>
inline void
bidirectional_g raph_helper_wit h_property<Conf ig>::remove_edg e(typename
Config::edge_de scriptor e)
{
typedef typename Config::graph_t ype graph_type;
graph_type& g = static_cast<gra ph_type&>(*this );
boost::remove_e dge(source(e, g), target(e, g), *this);
}
// O(E/V) or O(log(E/V))
template <class EdgeOrIter, class Config>
inline void
remove_edge(Edg eOrIter e,
bidirectional_g raph_helper_wit h_property<Conf ig>& g_)
{
g_.remove_edge( e);
}
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2039: 'dm' : is not a
member of '_mfi'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2143: syntax error :
missing ';' before '<'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2501: 'dm' : missing
storage-class or type specifiers
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2059: syntax error : ';'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2059: syntax error : '<'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2653: 'T' : is not a
class or namespace name
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2645: no qualified name
for pointer to member (found ':: *')
W:\boost_1_31_0 \boost/mem_fn.hpp(320) : error C2143: syntax error :
missing ';' before '}'
W:\boost_1_31_0 \boost/mem_fn.hpp(320) : fatal error C1506:
unrecoverable block scoping error
rem The problem area in mem_fn.hpp is here ...
creating a template class at the end of mem_fn.hpp
template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f)
{
return _mfi::dm<R, T>(f);
}
} // namespace boost
rem build hello world
W:
vcvars32.bat
set PYTHON_ROOT=F:\ Python23
set PYTHON_VERSION= 2.3
set PATH=%PATH%;W:\ boost_1_31_0\to ols\build\jam_s rc\bin.ntx86
rem APPEND THE BJAM PATH ABOVE TO THE SYSTEM ENVRONMENT VARIABLE PATH
cd W:\boost_1_31_0 \libs\python\ex ample\tutorial
bjam -sTOOLS=msvc
The results are as follows
W:\boost_1_31_0 \libs\python\ex ample\tutorial> bjam -sTOOLS=msvc
....found 1978 targets...
....updating 7 targets...
vc-C++
...\..\..\..\bi n\boost\libs\py thon\build\boos t_python.dll\ms vc\debug\inheri tance.obj
inheritance.cpp
W:\boost_1_31_0 \boost/graph/detail/adjacency_list. hpp(1055) : error
C2244: 'bidirectional_ graph_helper_wi th_property<Con fig>::remove_ed ge'
: unable to resolve function overload
W:\boost_1_31_0 \boost/graph/detail/adjacency_list. hpp(1057) : error
C2954: template definitions cannot nest
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2039: 'dm' : is not a
member of '_mfi'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2143: syntax error :
missing ';' before '<'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2501: 'dm' : missing
storage-class or type specifiers
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2059: syntax error : ';'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2059: syntax error : '<'
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2653: 'T' : is not a
class or namespace name
W:\boost_1_31_0 \boost/mem_fn.hpp(315) : error C2645: no qualified name
for pointer to member (found ':: *')
W:\boost_1_31_0 \boost/mem_fn.hpp(320) : error C2143: syntax error :
missing ';' before '}'
W:\boost_1_31_0 \boost/mem_fn.hpp(320) : fatal error C1506:
unrecoverable block scoping error
"cl" /Zm800 -nologo -GX -c -DBOOST_PYTHON_D YNAMIC_LIB
-DBOOST_PYTHON_S OURCE /Z7 /Od /Ob0 /GX /GR /MDd
-I"..\..\..\..\b in\boost\libs\p ython\build" -I"W:\boost_1_31 _0"
-I"F:\Python23\i nclude" -I"F:\PROGRA~1\M ICROS~3\VC98\in clude"
-Fo"..\..\..\. .
\bin\boost\libs \python\build\b oost_python.dll \msvc\debug\inh eritance.obj"
-Tp"W:\boost_1_3 1_0\libs\python \build\../src/object/inheritance.cpp "
....failed vc-C++
...\..\..\..\bi n\boost\libs\py thon\build\boos t_python.dll\ms vc\debug\inheri tance.obj...
....skipped
<@boost!libs!py thon!build\boos t_python.dll\ms vc\debug>boost_ python.CMD
for lack of
<@boost!libs!py thon!build\boos t_python.dll\ms vc\debug>inheri tance.obj...
....skipped
<@boost!libs!py thon!build\boos t_python.dll\ms vc\debug>boost_ python.dll
for lack of
<@boost!libs!py thon!build\boos t_python.dll\ms vc\debug>boost_ python.CMD...
....skipped
<@boost!libs!py thon!build\boos t_python.dll\ms vc\debug>boost_ python.lib
for lack of
<@boost!libs!py thon!build\boos t_python.dll\ms vc\debug>boost_ python.CMD...
....skipped
<@boost!libs!py thon!example!tu torial\hello.py d\msvc\debug>he llo.CMD for
lack of
<@boost!libs!py thon!build\boos t_python.dll\ms vc\debug>boost_ python.lib...
....skipped
<@boost!libs!py thon!example!tu torial\hello.py d\msvc\debug>he llo.pyd for
lack of
<@boost!libs!py thon!build\boos t_python.dll\ms vc\debug>boost_ python.dll...
....skipped
<@boost!libs!py thon!example!tu torial\hello.py d\msvc\debug>he llo.lib for
lack of
<@boost!libs!py thon!build\boos t_python.dll\ms vc\debug>boost_ python.dll...
....failed updating 1 target...
....skipped 6 targets...
W:\boost_1_31_0 \libs\python\ex ample\tutorial> dir hello*.*
rem results: ALL hello.CMD hello.pyd hello.lib NOT FOUND
Any Ideas about a possible solution?
AIM