pyOCIO Windows compilation error against Python36


renau...@...
 

I downloaded the latest OCIO code from GitHub (1.1.0) and I was able to compile OCIO using "Visual Studio 2015" as-well as pyOpenColorIO against Python27.

However when I tried to compile it against Python36 I get the following error:

...

9>  PyLogTransform.cpp
9>  PyLook.cpp
9>  PyLookTransform.cpp
9>  PyMain.cpp
9>D:\Development\Libraries\src\ocio\src\bindings\python\PyMain.cpp(153): error C2059: syntax error: '__declspec(dllexport)'
9>D:\Development\Libraries\src\ocio\src\bindings\python\PyMain.cpp(154): error C2143: syntax error: missing ';' before '{'
9>D:\Development\Libraries\src\ocio\src\bindings\python\PyMain.cpp(154): error C2447: '{': missing function header (old-style formal list?)

9>  PyMatrixTransform.cpp
9>  PyProcessor.cpp
9>  PyProcessorMetadata.cpp
9>  Generating Code...
9>  Compiling...
9>  PyRangeTransform.cpp
9>  PyTransform.cpp
9>  PyUtil.cpp
9>  Generating Code...
========== Build: 8 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Line 153 points to this :

OCIO_NAMESPACE_EXIT

MOD_INIT(PyOpenColorIO)
{
   
PyObject * m;
    MOD_DEF
(m, OCIO_STRINGIFY(PYOCIO_NAME), OCIO::OPENCOLORIO__DOC__, PyOCIO_methods);


MOD_INIT definition looks like this:

pyMain.cpp

...
#if PY_MAJOR_VERSION >= 3
 
#define MOD_ERROR_VAL NULL
 
#define MOD_SUCCESS_VAL(val) val
  #define MOD_INIT(name) PyMODINIT_FUNC EXPORT_SYMBOL PyInit_##name(void)
 
#define MOD_DEF(ob, name, doc, methods) \
         
static struct PyModuleDef moduledef = { \
           
PyModuleDef_HEAD_INIT, name, doc, -1, methods, NULL, NULL, NULL, NULL}; \
          ob
= PyModule_Create(&moduledef);

pyMODINIT_FUNC is defined here:

PyUtil.h

...
       
/* module init functions outside the core must be exported */
#                       if defined(__cplusplus)
#                               define PyMODINIT_FUNC extern "C" __declspec(dllexport) PyObject*
#                       else /* __cplusplus */
#                               define PyMODINIT_FUNC __declspec(dllexport) PyObject*
#                       endif /* __cplusplus */

and EXPORT_SYMBOL here:

PyUtil.h

#ifdef WIN32
    #define EXPORT_SYMBOL _declspec(dllexport)
#else
   
#define EXPORT_SYMBOL
#endif


I checked online to see if I could figure out what's causing the issue but I couldn't figure it out. Anybody would know why this is happening ?
Was anyone able to compile OCIO 1.1.0 | Win64 | Visual Studio 2015 | Python36 (official 64 bit build) ?

Thanks.

Join ocio-dev@lists.aswf.io to automatically receive all group messages.