#16 Error building on Mac OS X 10.4

closed-fixed
nobody
None
5
2005-08-29
2005-07-18
steve steiner
No

######################################
### This worked just fine, just showing order
### I did things in
######################################
~/Desktop/Downloads/pycxx_5_3_2->python setup.py install
running install
running build
running build_py
running install_lib
running install_headers
running install_data

######################################
### This, obviously, didn't work at all well
######################################
~/Desktop/Downloads/pycxx_5_3_2->cd Demo;python setup.py
install
running install
running build
running build_py
package init file './__init__.py' not found (or not a regular file)
package init file './__init__.py' not found (or not a regular file)
running build_ext
building 'CXX.example' extension
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-
fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -
Wstrict-prototypes -I/Library/Frameworks/Python.framework/
Versions/2.4/include/python2.4 -c example.cxx -o build/
temp.darwin-8.1.0-Power_Macintosh-2.4/example.o
cc1plus: warning: command line option "-Wstrict-prototypes" is
valid for C/ObjC but not for C++
example.cxx: In function `void initexample()':
example.cxx:499: warning: unused variable 'example'
/Library/Frameworks/Python.framework/Versions/2.4/include/
python2.4/CXX/Extensions.hxx: In constructor
`Py::PythonExtension<T>::PythonExtension() [with T = range]':
range.hxx:16: instantiated from here
/Library/Frameworks/Python.framework/Versions/2.4/include/
python2.4/CXX/Extensions.hxx:472: warning: right-hand operand
of comma has no effect
/usr/include/gcc/darwin/4.0/c++/bits/stl_algobase.h: In static
member function `static void std::__iter_swap<true>::iter_swap
(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 =
Py::SeqBase<Py::Object>::iterator, _ForwardIterator2 =
Py::SeqBase<Py::Object>::iterator]':
/usr/include/gcc/darwin/4.0/c++/bits/stl_algobase.h:158:
instantiated from `void std::iter_swap(_ForwardIterator1,
_ForwardIterator2) [with _ForwardIterator1 =
Py::SeqBase<Py::Object>::iterator, _ForwardIterator2 =
Py::SeqBase<Py::Object>::iterator]'
/usr/include/gcc/darwin/4.0/c++/bits/stl_algo.h:2038: instantiated
from `_RandomAccessIterator std::__unguarded_partition
(_RandomAccessIterator, _RandomAccessIterator, _Tp) [with
_RandomAccessIterator = Py::SeqBase<Py::Object>::iterator,
_Tp = Py::seqref<Py::Object>]'
/usr/include/gcc/darwin/4.0/c++/bits/stl_algo.h:2499: instantiated
from `void std::__introsort_loop(_RandomAccessIterator,
_RandomAccessIterator, _Size) [with _RandomAccessIterator =
Py::SeqBase<Py::Object>::iterator, _Size = int]'
/usr/include/gcc/darwin/4.0/c++/bits/stl_algo.h:2570: instantiated
from `void std::sort(_RandomAccessIterator,
_RandomAccessIterator) [with _RandomAccessIterator =
Py::SeqBase<Py::Object>::iterator]'
example.cxx:203: instantiated from here
/usr/include/gcc/darwin/4.0/c++/bits/stl_algobase.h:127: error:
invalid initialization of non-const reference of type
'Py::seqref<Py::Object>&' from a temporary of type
'Py::seqref<Py::Object>'
/usr/include/gcc/darwin/4.0/c++/bits/stl_algobase.h:92: error: in
passing argument 1 of 'void std::swap(_Tp&, _Tp&) [with _Tp =
Py::seqref<Py::Object>]'
error: command 'gcc' failed with exit status 1

Discussion

  • Logged In: YES
    user_id=28665

    This is worked around in V5.3.4. The root cause is GCC 4.0
    implements ieterators strictly accounding to the C++ 1998
    standard.
    The C++ standard outlaws the use of proxy objects with
    iterators.
    The Py::List::iterator requires poxy object support.
    The calls to std::sort have been commented out of the tests
    until I can figure out a solution to the iterator issue.

    You can use G++-3.3 on the Mac and all will work.

     
    • status: open --> closed-fixed