1
$\begingroup$

I'm learning how to use Python and want to reference some C functions own Blender API. However I've come across this problem in compiling *.pyx:

C:\BlenderDEV\blender\source\blender\bmesh\intern/bmesh_operator_api_inline.h:42
:38: error: '_bmo_elem_flag_test' declared as an 'inline' variable
 BLI_INLINE short _bmo_elem_flag_test(BMesh *bm, BMFlagLayer *oflags, const shor
t oflag)

What problem is that? How can I fix?

"error: '_bmo_elem_flag_test' declared as an 'inline' variable"

I summarized the *.pyx to help solving my problem:

    # file: bvh.pxd

cdef extern from "BLI_utildefines.h": # defines BLI_INLINE and define BLI_STATIC_ASSERT
    pass

cdef extern from "BLI_compiler_attrs.h": #'ATTR_WARN_UNUSED_RESULT'
    pass

cdef extern from "bmesh_operator_api_inline.h":
    pass

cdef extern from "bmesh_operator_api.h": # defines BMOpTypeFlag
    pass

And here is my setup.py

# file: setup.py

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import platform


libraries=[]
extra_compile_args=[]
extra_link_args=[]
include_dirs=["C:\\BlenderDEV\\blender\\source\\blender\\blenlib",
              "C:\\BlenderDEV\\blender\\source\\blender\makesdna",
              "C:\\BlenderDEV\\blender\\source\\blender\\bmesh",
              "C:\\BlenderDEV\\blender\\source\\blender\\bmesh\\intern"]

setup(
    name = "BVH defs",
    cmdclass = {"build_ext": build_ext},
    ext_modules = [Extension(
        "bvh2",                     # name of extension
        ["bvh.pyx"],                # filename of our Pyrex/Cython source
        language="c++",             # this causes Pyrex/Cython to create C++ 

source
        include_dirs=include_dirs,
        libraries=libraries,
        extra_compile_args=extra_compile_args,
        extra_link_args=extra_link_args,
        embedsignature=True
        )]
    )

I'm already racking my brain for days Anyone?

Edit

Solved. I think it was that I forgot to set the header bmesh_class.h structures

$\endgroup$
3
  • $\begingroup$ Resolved. I think it was that I forgot to set the header bmesh_class.h structures $\endgroup$
    – Mano-Wii
    Nov 1 '15 at 20:45
  • $\begingroup$ Just out of interest: What you are trying to achieve? $\endgroup$
    – p2or
    Nov 2 '15 at 9:02
  • $\begingroup$ goal was to test the best possible performance in a module in python. You can see the result here: blenderartists.org/forum/… $\endgroup$
    – Mano-Wii
    Nov 2 '15 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.