Skip to content

cmake nmake generator failing #981

Open
@meshula

Description

@meshula

Using this command line:

cmake ../openexr -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=./install

Note that the nmake generator has selected x86, I'm wondering if that's why the zlib link fails.

Example:

[ 33%] Building CXX object src/lib/OpenEXR/CMakeFiles/OpenEXR.dir/ImfStringVectorAttribute.cpp.obj
ImfStringVectorAttribute.cpp
C:\Projects\Lucasfilm\openexr\src\lib\OpenEXR\ImfStringVectorAttribute.cpp(80): warning C4275: non dll-interface class 'Imf_3_0::Attribute' used as base for dll-interface class 'Imf_3_0::TypedAttribute<Imf_3_0::StringVector>'
C:\Projects\Lucasfilm\openexr\src\lib\OpenEXR\ImfAttribute.h(28): note: see declaration of 'Imf_3_0::Attribute'
C:\Projects\Lucasfilm\openexr\src\lib\OpenEXR\ImfStringVectorAttribute.h(29): note: see declaration of 'Imf_3_0::TypedAttribute<Imf_3_0::StringVector>'
C:\Projects\Lucasfilm\openexr\src\lib\OpenEXR\ImfStringVectorAttribute.cpp(80): warning C4251: 'Imf_3_0::TypedAttribute<Imf_3_0::StringVector>::_value': class 'std::vector<std::string,std::allocator<std::string>>' needs to have dll-interface to be used by clients of class 'Imf_3_0::TypedAttribute<Imf_3_0::StringVector>'
C:\Projects\Lucasfilm\openexr\src\lib\OpenEXR\ImfStringVectorAttribute.h(28): note: see declaration of 'std::vector<std::string,std::allocator<std::string>>'

link failing on zlib

[ 47%] Linking CXX shared library ..\..\..\bin\OpenEXR-3_0_d.dll
LINK Pass 1: command "C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1426~1.288\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\OpenEXR.dir\objects1.rsp /out:..\..\..\bin\OpenEXR-3_0_d.dll /implib:OpenEXR-3_0_d.lib /pdb:C:\Projects\Lucasfilm\build\bin\OpenEXR-3_0_d.pdb /dll /version:26.0 /machine:X86 /debug /INCREMENTAL ..\IlmThread\IlmThread-3_0_d.lib ..\..\..\_deps\imath-build\src\Imath\Imath-3_0_d.lib C:\Users\meshu\miniconda3\Library\lib\z.lib ..\Iex\Iex-3_0_d.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\OpenEXR.dir/intermediate.manifest CMakeFiles\OpenEXR.dir/manifest.res" failed (exit code 1120) with the following output:
   Creating library OpenEXR-3_0_d.lib and object OpenEXR-3_0_d.exp
ImfDwaCompressor.cpp.obj : error LNK2019: unresolved external symbol _compress2 referenced in function "private: int __thiscall Imf_3_0::DwaCompressor::compress(char const *,int,class Imath_3_0::Box<class Imath_3_0::Vec2<int> >,char const * &)" (?compress@DwaCompressor@Imf_3_0@@AAEHPBDHV?$Box@V?$Vec2@H@Imath_3_0@@@Imath_3_0@@AAPBD@Z)
ImfDwaCompressor.cpp.obj : error LNK2019: unresolved external symbol _compressBound referenced in function "private: int __thiscall Imf_3_0::DwaCompressor::compress(char const *,int,class Imath_3_0::Box<class Imath_3_0::Vec2<int> >,char const * &)" (?compress@DwaCompressor@Imf_3_0@@AAEHPBDHV?$Box@V?$Vec2@H@Imath_3_0@@@Imath_3_0@@AAPBD@Z)
ImfIDManifest.cpp.obj : error LNK2001: unresolved external symbol _compressBound
ImfDwaCompressor.cpp.obj : error LNK2019: unresolved external symbol _uncompress referenced in function "private: int __thiscall Imf_3_0::DwaCompressor::uncompress(char const *,int,class Imath_3_0::Box<class Imath_3_0::Vec2<int> >,char const * &)" (?uncompress@DwaCompressor@Imf_3_0@@AAEHPBDHV?$Box@V?$Vec2@H@Imath_3_0@@@Imath_3_0@@AAPBD@Z)
ImfPxr24Compressor.cpp.obj : error LNK2001: unresolved external symbol _uncompress
ImfZip.cpp.obj : error LNK2001: unresolved external symbol _uncompress
ImfIDManifest.cpp.obj : error LNK2001: unresolved external symbol _uncompress

This command line invocation yields a working build:

cmake ../openexr -G "Visual Studio 16 2019" -Ax64 -DCMAKE_INSTALL_PREFIX=./install

However, the symbol visibility warnings still exist:

C:\Projects\Lucasfilm\openexr\src\lib\OpenEXR\ImfAttribute.h(106,1): warning C4275: non dll-interface class 'Imf_3_0::Attribute' used as base for dll-interface cla
ss 'Imf_3_0::TypedAttribute<Imath_3_0::V3f>' [C:\Projects\Lucasfilm\build\src\bin\exrstdattr\exrstdattr.vcxproj]
C:\Projects\Lucasfilm\openexr\src\lib\OpenEXR\ImfAttribute.h(28): message : see declaration of 'Imf_3_0::Attribute' [C:\Projects\Lucasfilm\build\src\bin\exrstdattr
\exrstdattr.vcxproj]
C:\Projects\Lucasfilm\openexr\src\lib\OpenEXR\ImfVecAttribute.h(33): message : see declaration of 'Imf_3_0::TypedAttribute<Imath_3_0::V3f>' [C:\Projects\Lucasfilm\
build\src\bin\exrstdattr\exrstdattr.vcxproj]
C:\Projects\Lucasfilm\openexr\src\lib\OpenEXR\ImfVecAttribute.h(41): message : see reference to class template instantiation 'Imf_3_0::TypedAttribute<Imath_3_0::V3
f>' being compiled [C:\Projects\Lucasfilm\build\src\bin\exrstdattr\exrstdattr.vcxproj]
C:\P

Metadata

Metadata

Assignees

No one assigned

    Labels

    BuildA problem with building or installing the library.Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions