...
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 ==========
OCIO_NAMESPACE_EXIT
MOD_INIT(PyOpenColorIO)
{
PyObject * m;
MOD_DEF(m, OCIO_STRINGIFY(PYOCIO_NAME), OCIO::OPENCOLORIO__DOC__, PyOCIO_methods);
...
#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);
...
/* 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 */
#ifdef WIN32
#define EXPORT_SYMBOL _declspec(dllexport)
#else
#define EXPORT_SYMBOL
#endif
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.
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) ?
Hi Guys,
Thanks for your investigations around Python 3.
OCIO does not currently support Python 3. But it would be appreciated to have a pull request fixing the Python 3 support :-)
Patrick.
Hi Richard,
Thank you for your suggestions, I did look into your diff files but I couldn’t find anything that’s not already added to the current versions of the files.
I got it to compile with Windows 10 / Python 3.6 – Visual Studio 2015, by changing the following line in “pyUtil.h” (line 65):
from :
#define MOD_INIT(name) PyMODINIT_FUNC EXPORT_SYMBOL PyInit_##name(void)
to:
#define MOD_INIT(name) EXPORT_SYMBOL PyMODINIT_FUNC PyInit_##name(void)
I did get a warning message though but the compilation process went through and the “.pyd” file was generated.
I’m honestly no C++ expert so I’m not sure if this makes sense but it seems to work. I need to run further testing next week to confirm but so far so good.
Thanks again,
Renaud