Closed crgnam closed 4 days ago
First of all, test with latest version of openimageio in vcpkg. I recently made the existing test port build a test program, to verify fixes for some linking issues.
@dg0yt I have tested with the most recent version (2.5.12.0#1). I apologize for not making that clear. I've tested with the most recent version, as well as several old ones. The version included here was just the last one I tested before deciding to post this. My apologies for the confusion
vcpkg.json
in https://github.com/crgnam/oiio-linker-error still refers to the outdated version.
@dg0yt like I have just updated the vcpkg.json
in the repo to the most recent version (which I have already attempted). It does not resolve the problem
Okay.
So the openimageio libs link to boost targets with $<TARGET_NAME_IF_EXISTS:Boost::filesystem>
etc.
And CMake exports it like this.
And CMake config lacks find_dependency(Boost COMPONENTS filesystem ...)
.
And so it fails to link. :disappointed:
No, you really need to update to the the most recent version:2.5.12.0#2
. It has the fix in port openimageio.
And you should update the builtin-baseline
. Because the boost ports where changed to build with CMake. Which helps to get CMake dependencies right.
@dg0yt I'm not seeing a 2.5.12.0#2 as available even when I git pull vcpkg
and update the baseline to the most recent hash. Looking online at: https://vcpkg.io/en/package/openimageio it also shows the most recent version available as 2.5.12.0#1.
Is there something I need to do to get access to 2.5.12.0#2?
Are you sure you are on master
, on microsoft/vcpkg?
https://github.com/microsoft/vcpkg/blob/576379156e82da642f8d1834220876759f13534d/ports/openimageio/vcpkg.json#L3-L4
Truly I'm not sure what happened. I walked away from the computer for a few hours, came back and now its working. The website still isn't showing having 2.5.12.0#2 yet, but my local vcpkg has properly installed it and everything linked correctly now. So thank you very much for the fix, and your patience working me through it, I very much appreciate it!
Bug Description:
I have a library that links to OpenImageIO, and I later build applications which link to my library. This all works 100% fine on Windows 10 (MSVC 17.6). However, on Ubuntu 20.04.6 (g++ 10.5.0, ld 2.34), my library builds and links successfully, but all applications fail to link against it with many errors stating an undefined reference to various things from boost.
I am including a minimal working example below. I am making this a vcpkg issue because when I install OpenImageIO using
sudo apt install libopenimageio-dev
and then use:my applications will successfully link to my library and run as expected. So I do not believe the problem is specific to the OpenImageIO library itself, but perhaps something to do with how it was ported to vcpkg.
Environment:
To Reproduce:
An minimal working example is available here: https://github.com/crgnam/oiio-linker-error, but I will outline it below for completeness:
vcpkg.json
:CMakeLists.txt
:mylib.hpp
:mylib.cpp
:myapp.cpp
:Build with:
Expected behavior:
I expect that my library builds and links successfully, and that applications will build and link to my library successfully. Things work as expected on Windows 10 (MSVC 17.6) as well as when I install OpenImageIO with
apt
on Ubuntu (and make the appropriate changes to theCMakeLists.txt
as outlined above)Failure logs:
Additional context:
Things work as expected on Windows 10 (MSVC 17.6). Things also work as expected on Ubuntu when OpenImageIO is installed with
sudo apt install libopenimageio-dev
and theCMakeLists.txt
is changed to: