DavidBrainard / RenderToolbox3

Matlab toolbox for managing graphics rendering for psychophysics
MIT License
11 stars 4 forks source link

MakeReadMultichannelEXR fails with missing uint32_t definition #43

Closed benjamin-heasly closed 10 years ago

benjamin-heasly commented 10 years ago

A user (Maria) tried to run MakeReadMultichannelEXR on Mint Linux (15:Olivia) with 64-bit Matlab2013b.

Maria had all the required packages installed (collada, openexr etc.) and set paths to the OpenEXR libraries and headers MakeReadMultichannelEXR.m file.

But MakeReadMultichannelEXR gave an error:


MakeReadMultichannelEXR mex CFLAGS="\$CFLAGS -Wall" -I/usr/local/include/OpenEXR/ -L/usr/local/lib/ -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -lpthread -o ReadMultichannelEXR ReadMultichannelEXR.cpp ReadMultichannelEXR.cpp: In function ‘void mexFunction(int, mxArray, int, const mxArray)’: ReadMultichannelEXR.cpp:110:25: error: ‘uint32_t’ was not declared in this scope ReadMultichannelEXR.cpp:110:33: error: template argument 1 is invalid ReadMultichannelEXR.cpp:110:46: error: invalid type in declaration before ‘;’ token ReadMultichannelEXR.cpp:111:29: error: request for member ‘resizeErase’ in ‘slicePixels’, which is of non-class type ‘int’ ReadMultichannelEXR.cpp:114:48: error: invalid types ‘int[int]’ for array subscript ReadMultichannelEXR.cpp:115:45: error: invalid types ‘int[int]’ for array subscript ReadMultichannelEXR.cpp:116:45: error: invalid types ‘int[int]’ for array subscript ReadMultichannelEXR.cpp:126:85: error: invalid types ‘int[int]’ for array subscript

mex: compile of ' "ReadMultichannelEXR.cpp"' failed.

Unable to complete successfully.

benjamin-heasly commented 10 years ago

I think the problem comes from the way portable integer types are defined in C vs. C++: http://stackoverflow.com/questions/13642827/cstdint-vs-stdint-h http://stackoverflow.com/questions/5162784/uint32-t-identifier-not-found-error

I changed the ReadMultichannelEXR.cpp to use Matlab's portable integer types: https://github.com/DavidBrainard/RenderToolbox3/commit/44e83dfd4bbcb7fded5ca1d11e3225db284c3f96

This worked on my OS X machine.

I want to leave the issue open until someone else (Maria) tries it.

benjamin-heasly commented 10 years ago

Maria reports that this worked now under Mint Linux.