I have been using swig to wrap a C++ library into a Python module. It
used to work fine with older versions of gcc but after switching to gcc
4.6, I am getting this:
"error: taking address of temporary [-fpermissive]"
By looking at the wrapper file, I found that this happens to attributes
of type string or vector or other STL types [they are specified via getter
function returning string, etc].
I tried using -naturalvar flag with swig, but that did not help. If I use
-fpermissive with g++, the generated module causes segmentation fault (at
load time for a debug build, at runtime for a build without the debug
I suspect most people wrapping c++ have functions that return a local
string or vector but I could not find any recommended workaround on the