Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building OCIO 2.4 on Windows gave a Linker errors to OpenColorIO_v2_4::OglApp #2081

Open
ssh4net opened this issue Oct 16, 2024 · 3 comments

Comments

@ssh4net
Copy link

ssh4net commented Oct 16, 2024

cmake command:

cmake -D BUILD_SHARED_LIBS=ON -D OCIO_VERBOSE=ON -D ENABLE_SHARED=ON ^
-D OCIO_INSTALL_EXT_PACKAGES=NONE -D OCIO_BUILD_PYTHON=OFF -D OCIO_BUILD_APPS=ON ^
-D OCIO_BUILD_GPU_TESTS=OFF -D OCIO_BUILD_DOCS=OFF -D OCIO_BUILD_TESTS=OFF ^
-D Imath_LIBRARY=e:/DVR/lib/Imath-3_2.lib ^
-D expat_LIBRARY=e:/DVR/lib/libexpat.lib ^
-D GLEW_INCLUDE_DIRS=e:/DVR/include/GL ^
-D lcms2_ROOT=e:/GH/Little-CMS ^
-D lcms2_INCLUDE_DIR=e:/GH/Little-CMS/include ^
-D lcms2_LIBRARY=e:/GH/Little-CMS/bin/lcms2.lib ^
-D minizip-ng_LIBRARY=e:/DVR/lib/libminizip-ng.lib ^
-D yaml-cpp_LIBRARY=e:/DVR/lib/yaml-cpp.lib ^
-D yaml-cpp_INCLUDE_DIR=e:/DVR/include/yaml-cpp ^
-D pystring_LIBRARY=e:/DVR/lib/pystring.lib ^
-D DOXYGEN_EXECUTABLE="c:/Program Files/doxygen/bin/doxygen.exe" ^
-D CMAKE_BUILD_TYPE=Release ^
-D CMAKE_DEBUG_POSTFIX=_d ^
-D CMAKE_PREFIX_PATH=e:/DVR ^
-D CMAKE_INSTALL_PREFIX=e:/DVR ..

building:

cmake --build . --config Release --target install -j32
cmake --build . --config Release --target install -j32
MSBuild version 17.11.9+a69bbaaf5 for .NET Framework

  1>Checking Build System
  ociocpuinfo.vcxproj -> E:\GH\OpenColorIO\build\src\apps\ociocpuinfo\Release\ociocpuinfo.exe
  OpenColorIO.vcxproj -> E:\GH\OpenColorIO\build\src\OpenColorIO\Release\OpenColorIO_2_4.dll
  imageioapphelpers.vcxproj -> E:\GH\OpenColorIO\build\src\libutils\imageioapphelpers\Release\OpenColorIOimageioapphelpers.lib
  oglapphelpers.vcxproj -> E:\GH\OpenColorIO\build\src\libutils\oglapphelpers\Release\OpenColorIOoglapphelpers.lib
  apputils.vcxproj -> E:\GH\OpenColorIO\build\src\apputils\Release\apputils.lib
  ociomakeclf.vcxproj -> E:\GH\OpenColorIO\build\src\apps\ociomakeclf\Release\ociomakeclf.exe
  ociocheck.vcxproj -> E:\GH\OpenColorIO\build\src\apps\ociocheck\Release\ociocheck.exe
  ocioarchive.vcxproj -> E:\GH\OpenColorIO\build\src\apps\ocioarchive\Release\ocioarchive.exe
  ociobakelut.vcxproj -> E:\GH\OpenColorIO\build\src\apps\ociobakelut\Release\ociobakelut.exe
  ociolutimage.vcxproj -> E:\GH\OpenColorIO\build\src\apps\ociolutimage\Release\ociolutimage.exe
  ocioperf.vcxproj -> E:\GH\OpenColorIO\build\src\apps\ocioperf\Release\ocioperf.exe
  ociowrite.vcxproj -> E:\GH\OpenColorIO\build\src\apps\ociowrite\Release\ociowrite.exe
main.obj : error LNK2019: unresolved external symbol "public: void __cdecl OpenColorIO_v2_4::OglApp::createGLBuffers(void)" (?createGLBuffers@OglApp@OpenColorIO_v2_4@@QEAAXXZ) referenced in function main [E:\GH\OpenColorIO\build\src\apps\ocioconvert\ocioconvert.vcxproj]
main.obj : error LNK2019: unresolved external symbol "public: void __cdecl OpenColorIO_v2_4::OglApp::reshape(int,int)" (?reshape@OglApp@OpenColorIO_v2_4@@QEAAXHH@Z) referenced in function main [E:\GH\OpenColorIO\build\src\apps\ocioconvert\ocioconvert.vcxproj]
main.obj : error LNK2019: unresolved external symbol "public: static class std::shared_ptr<class OpenColorIO_v2_4::OglApp> __cdecl OpenColorIO_v2_4::OglApp::CreateOglApp(char const *,int,int)" (?CreateOglApp@OglApp@OpenColorIO_v2_4@@SA?AV?$shared_ptr@VOglApp@OpenColorIO_v2_4@@@std@@PEBDHH@Z) referenced in function
 main [E:\GH\OpenColorIO\build\src\apps\ocioconvert\ocioconvert.vcxproj]
E:\GH\OpenColorIO\build\src\apps\ocioconvert\Release\ocioconvert.exe : fatal error LNK1120: 3 unresolved externals [E:\GH\OpenColorIO\build\src\apps\ocioconvert\ocioconvert.vcxproj]
main.obj : error LNK2019: unresolved external symbol "public: void __cdecl OpenColorIO_v2_4::OglApp::reshape(int,int)" (?reshape@OglApp@OpenColorIO_v2_4@@QEAAXHH@Z) referenced in function "void __cdecl Reshape(int,int)" (?Reshape@@YAXHH@Z) [E:\GH\OpenColorIO\build\src\apps\ociodisplay\ociodisplay.vcxproj]
main.obj : error LNK2019: unresolved external symbol "public: void __cdecl OpenColorIO_v2_4::OglApp::createGLBuffers(void)" (?createGLBuffers@OglApp@OpenColorIO_v2_4@@QEAAXXZ) referenced in function "public: void __cdecl `anonymous namespace'::ProcessorWrapper::setGPU(class std::shared_ptr<class OpenColorIO_v2_4::
GPUProcessor const >)" (?setGPU@ProcessorWrapper@?A0x6d82f1bc@@QEAAXV?$shared_ptr@$$CBVGPUProcessor@OpenColorIO_v2_4@@@std@@@Z) [E:\GH\OpenColorIO\build\src\apps\ociochecklut\ociochecklut.vcxproj]
main.obj : error LNK2019: unresolved external symbol "public: __cdecl OpenColorIO_v2_4::ScreenApp::ScreenApp(char const *,int,int)" (??0ScreenApp@OpenColorIO_v2_4@@QEAA@PEBDHH@Z) referenced in function main [E:\GH\OpenColorIO\build\src\apps\ociodisplay\ociodisplay.vcxproj]
main.obj : error LNK2019: unresolved external symbol "public: void __cdecl OpenColorIO_v2_4::OglApp::reshape(int,int)" (?reshape@OglApp@OpenColorIO_v2_4@@QEAAXHH@Z) referenced in function main [E:\GH\OpenColorIO\build\src\apps\ociochecklut\ociochecklut.vcxproj]
E:\GH\OpenColorIO\build\src\apps\ociodisplay\Release\ociodisplay.exe : fatal error LNK1120: 2 unresolved externals [E:\GH\OpenColorIO\build\src\apps\ociodisplay\ociodisplay.vcxproj]
main.obj : error LNK2019: unresolved external symbol "public: static class std::shared_ptr<class OpenColorIO_v2_4::OglApp> __cdecl OpenColorIO_v2_4::OglApp::CreateOglApp(char const *,int,int)" (?CreateOglApp@OglApp@OpenColorIO_v2_4@@SA?AV?$shared_ptr@VOglApp@OpenColorIO_v2_4@@@std@@PEBDHH@Z) referenced in function
 "public: void __cdecl `anonymous namespace'::ProcessorWrapper::setGPU(class std::shared_ptr<class OpenColorIO_v2_4::GPUProcessor const >)" (?setGPU@ProcessorWrapper@?A0x6d82f1bc@@QEAAXV?$shared_ptr@$$CBVGPUProcessor@OpenColorIO_v2_4@@@std@@@Z) [E:\GH\OpenColorIO\build\src\apps\ociochecklut\ociochecklut.vcxproj]
E:\GH\OpenColorIO\build\src\apps\ociochecklut\Release\ociochecklut.exe : fatal error LNK1120: 3 unresolved externals [E:\GH\OpenColorIO\build\src\apps\ociochecklut\ociochecklut.vcxproj]
@ssh4net
Copy link
Author

ssh4net commented Oct 16, 2024

Probably the problem is that on windows freeglut is always building as freeglut but on linux as glut?

FREEGLUT_REPLACE_GLUT       [ON, OFF] For non-Windows platforms,
                            freeglut is by default built as -lglut. if
                            off, built as -lfreeglut. On Windows,
                            libraries are always built as freeglut.

@num3ric
Copy link
Contributor

num3ric commented Oct 23, 2024

Not sure, but everything builds fine for me by installing the required dependencies via vcpkg and running the bat script under OpenColorIO\share\dev\windows. My command looks something like: ocio.bat --configure --vcpkg "C:\Users\eric.renaudhoude\Code\vcpkg" --type RelWithDebInfo --ocio "C:\Users\eric.renaudhoude\Code\OpenColorIO" --msvs "C:\Program Files\Microsoft Visual Studio\2022\Professional\" --b "D:\OCIO\build" --i "D:\OCIO\install" on main/latest.

@ssh4net
Copy link
Author

ssh4net commented Oct 25, 2024

Well, I need to use the zlib-ng (in compatible mode) library instead of zlib; that is faster. But I don't know the way to build vcpkg dependencies with zlib-ng when almost any library depends on zlib; as a result, I can't use and prefer to avoid vcpkg for other reasons.

I built OCIO 2.3+ before without issues, but this 2.4 don't want to compile.

What can be a reason why an "unresolved external symbol" can happen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants