AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO

Error when building shared libs on Windows.

Offen
#1,942 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Build Issue
Vorherrschende Sprache
C++
Sterne
2.1k
Forks
505
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi!
When building OCIO with shared libs on windows it fails to link correctly with Imath.
I get the following when building with Imath 3.1.10, OpenExr 3.2.1 and OpenColorIO 2.3.2
```
Lut1DOpData.obj : error LNK2001: unresolved external symbol imath_half_to_float_table
OpHelpers.obj : error LNK2001: unresolved external symbol imath_half_to_float_table
CPUProcessor.obj : error LNK2001: unresolved external symbol imath_half_to_float_table
FileFormatDiscreet1DL.obj : error LNK2001: unresolved external symbol imath_half_to_float_table
MathUtils.obj : error LNK2001: unresolved external symbol imath_half_to_float_table
Lut1DOpCPU.obj : error LNK2001: unresolved external symbol imath_half_to_float_table
..\vfxplatform_build\build\OpenColorIO\src\OpenColorIO\Release\OpenColorIO_2_3.dll : fatal error LNK1120: 1 unresolved externals
```
This seem to be a common issue with Imath and I think the solution is to define IMATH_DLL when needed, but I'm not sure where or with what logic it should be defined, but I guess only when building shared on Windows.
In my test to see if I could work around it I just added the define to FindImath.cmake and then it builds correctly.
More info in this Imath ticket https://github.com/AcademySoftwareFoundation/Imath/issues/212#issuecomment-1502764231

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit FindImath.cmake und reproduziere den Build der Windows-Shared-Library mit Imath 3.1.10, OpenEXR 3.2.1 und OpenColorIO 2.3.2. Prüfe, wie die Definition IMATH_DLL für diese Konfiguration angewendet werden sollte. Erledigt ist die Aufgabe, wenn der Build OpenColorIO_2_3.dll linkt, ohne die Fehler wegen nicht aufgelöster Symbole für imath_half_to_float_table.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cmake, cpp
Bereich
build-system
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
52/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.