openexr icon indicating copy to clipboard operation
openexr copied to clipboard

Building in Visual Studio using cmake fails

Open ileben opened this issue 3 years ago • 3 comments
trafficstars

I tried building OpenEXR using Visual Studio (both 2019 and 2022), by following these guidelines in the VS documentation about bulding CMake-based projects: https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170

Both VS2019 and VS2022 gave me the same error: C:\Users\ivanl\Projects\OpenEXR\out\build\x64-Debug\ninja : error : 'zlib-install/lib/zlibstatic.lib', needed by 'bin/OpenEXR-3_2_d.dll', missing and no known rule to make it

ileben avatar Jul 09 '22 04:07 ileben

We haven't tested Visual Studio's cmake integration as described in that link, but we always test building OpenEXR for Windows with Visual Studio from an x64 tools command prompt, using cmake. Perhaps start there and first verify you are able to build OpenEXR in the supported manner. After that, if you are able to determine why the build doesn't work when trying to use the VS cmake IDE integration, perhaps we can discuss solutions to make it work.

meshula avatar Jul 10 '22 00:07 meshula

I have since managed to build OpenEXR by using CMake-gui to run their VS solution generator, then opening the generated solution and building the generated BUILD_ALL and INSTALL projects. I was initially confused about what the cmake reference in the INSTALL instructions for Windows meant and so my intuition led me to google "Visual Studio cmake" and arrive at the VS docs linked in OP. Perhaps the INSTALL instructions could be more detailed in describing how exactly cmake is supposed to be used with VS in a way that OpenEXR supports for people like me who are not familiar with the usual cmake conventions.

ileben avatar Jul 10 '22 01:07 ileben

Glad to hear you got a build, and a workflow that works. Your suggestion to improve the build documentation is a good one.

meshula avatar Jul 10 '22 19:07 meshula