AcademySoftwareFoundation / AcademySoftwareFoundation/OpenShadingLanguage
Unresolved external symbols when building with batch mode on Windows
- Dominant language
- C++
- Stars
- 2.3k
- Forks
- 414
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 10
Description
### Problem
Building with `USE_BATCHED` options on Windows fails due to unresolved external symbols.
**Expected behavior:**
Successful build with `USE_BATCHED` option.
**Actual behavior:**
There are quite a few unresolved symbols, here are a few representative ones when using `USE_BATCHED=b8_AVX` :
```
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "public: class Imath_2_4::Color3 __cdecl OSL_v1_12::pvt::ColorSystem::to_rgb(class OpenImageIO_v2_4::ustring,class Imath_2_4::Color3 const &,class OSL_v1_12::ShadingContext *)const " (?to_rgb@ColorSystem@pvt@OSL_v1_12@@QEBA?AV?$Color3@M@Imath_2_4@@Vustring@OpenImageIO_v2_4@@AEBV45@PEAVShadingContext@3@@Z) referenced in function osl_b8_AVX_prepend_color_from_vs
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "public: class OSL_v1_12::Dual,2> __cdecl OSL_v1_12::pvt::ColorSystem::transformc(class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,class OSL_v1_12::Dual,2> const &,class OSL_v1_12::ShadingContext *)const " (?transformc@ColorSystem@pvt@OSL_v1_12@@QEBA?AV?$Dual@V?$Color3@M@Imath_2_4@@$01@3@Vustring@OpenImageIO_v2_4@@0AEBV43@PEAVShadingContext@3@@Z) referenced in function osl_b8_AVX_transform_color_vss
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "public: class Imath_2_4::Color3 __cdecl OSL_v1_12::pvt::ColorSystem::transformc(class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,class Imath_2_4::Color3 const &,class OSL_v1_12::ShadingContext *)const " (?transformc@ColorSystem@pvt@OSL_v1_12@@QEBA?AV?$Color3@M@Imath_2_4@@Vustring@OpenImageIO_v2_4@@0AEBV45@PEAVShadingContext@3@@Z) referenced in function osl_b8_AVX_transform_color_vss
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "public: class OSL_v1_12::Dual,2> __cdecl OSL_v1_12::pvt::ColorSystem::ocio_transform(class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,class OSL_v1_12::Dual,2> const &,class OSL_v1_12::ShadingContext *)const " (?ocio_transform@ColorSystem@pvt@OSL_v1_12@@QEBA?AV?$Dual@V?$Color3@M@Imath_2_4@@$01@3@Vustring@OpenImageIO_v2_4@@0AEBV43@PEAVShadingContext@3@@Z) referenced in function "public: void __cdecl OSL_v1_12::Mask<8>::foreach<0,8,class >(class )const " (??$foreach@$0A@$07V@@@?$Mask@$07@OSL_v1_12@@QEBAXV@@@Z)
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "public: class Imath_2_4::Color3 __cdecl OSL_v1_12::pvt::ColorSystem::ocio_transform(class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,class Imath_2_4::Color3 const &,class OSL_v1_12::ShadingContext *)const " (?ocio_transform@ColorSystem@pvt@OSL_v1_12@@QEBA?AV?$Color3@M@Imath_2_4@@Vustring@OpenImageIO_v2_4@@0AEBV45@PEAVShadingContext@3@@Z) referenced in function "public: void __cdecl OSL_v1_12::Mask<8>::foreach<0,8,class >(class )const " (??$foreach@$0A@$07V@@@?$Mask@$07@OSL_v1_12@@QEBAXV@@@Z)
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class OpenImageIO_v2_4::ustring const OSL_v1_12::Strings::rgb" (__imp_?rgb@Strings@OSL_v1_12@@3Vustring@OpenImageIO_v2_4@@B) referenced in function "void __cdecl OSL_v1_12::b8_AVX_pvt::`anonymous namespace'::wide_transformc >(class OSL_v1_12::pvt::ColorSystem,class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,struct OSL_v1_12::Masked,8>,struct OSL_v1_12::Wide const ,8>,class OSL_v1_12::ShadingContext *)" (??$wide_transformc@V?$Color3@M@Imath_2_4@@@?A0x24e98508@b8_AVX_pvt@OSL_v1_12@@YAXVColorSystem@pvt@2@Vustring@OpenImageIO_v2_4@@1U?$Masked@V?$Color3@M@Imath_2_4@@$07@2@U?$Wide@$$CBV?$Color3@M@Imath_2_4@@$07@2@PEAVShadingContext@2@@Z)
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class OpenImageIO_v2_4::ustring const OSL_v1_12::Strings::RGB" (__imp_?RGB@Strings@OSL_v1_12@@3Vustring@OpenImageIO_v2_4@@B) referenced in function "public:
void __cdecl OSL_v1_12::Mask<8>::foreach<0,8,class >(class )const " (??$foreach@$0A@$07V@@@?$Mask@$07@OSL_v1_12@@QEBAXV@@@Z)
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class OpenImageIO_v2_4::ustring const OSL_v1_12::Strings::hsv" (__imp_?hsv@Strings@OSL_v1_12@@3Vustring@OpenImageIO_v2_4@@B) referenced in function "void __cdecl OSL_v1_12::b8_AVX_pvt::`anonymous namespace'::wide_transformc >(class OSL_v1_12::pvt::ColorSystem,class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,struct OSL_v1_12::Masked,8>,struct OSL_v1_12::Wide const ,8>,class OSL_v1_12::ShadingContext *)" (??$wide_transformc@V?$Color3@M@Imath_2_4@@@?A0x24e98508@b8_AVX_pvt@OSL_v1_12@@YAXVColorSystem@pvt@2@Vustring@OpenImageIO_v2_4@@1U?$Masked@V?$Color3@M@Imath_2_4@@$07@2@U?$Wide@$$CBV?$Color3@M@Imath_2_4@@$07@2@PEAVShadingContext@2@@Z)
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class OpenImageIO_v2_4::ustring const OSL_v1_12::Strings::hsl" (__imp_?hsl@Strings@OSL_v1_12@@3Vustring@OpenImageIO_v2_4@@B) referenced in function "void __cdecl OSL_v1_12::b8_AVX_pvt::`anonymous namespace'::wide_transformc >(class OSL_v1_12::pvt::ColorSystem,class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,struct OSL_v1_12::Masked,8>,struct OSL_v1_12::Wide const ,8>,class OSL_v1_12::ShadingContext *)" (??$wide_transformc@V?$Color3@M@Imath_2_4@@@?A0x24e98508@b8_AVX_pvt@OSL_v1_12@@YAXVColorSystem@pvt@2@Vustring@OpenImageIO_v2_4@@1U?$Masked@V?$Color3@M@Imath_2_4@@$07@2@U?$Wide@$$CBV?$Color3@M@Imath_2_4@@$07@2@PEAVShadingContext@2@@Z)
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class OpenImageIO_v2_4::ustring const OSL_v1_12::Strings::YIQ" (__imp_?YIQ@Strings@OSL_v1_12@@3Vustring@OpenImageIO_v2_4@@B) referenced in function "void __cdecl OSL_v1_12::b8_AVX_pvt::`anonymous namespace'::wide_transformc >(class OSL_v1_12::pvt::ColorSystem,class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,struct OSL_v1_12::Masked,8>,struct OSL_v1_12::Wide const ,8>,class OSL_v1_12::ShadingContext *)" (??$wide_transformc@V?$Color3@M@Imath_2_4@@@?A0x24e98508@b8_AVX_pvt@OSL_v1_12@@YAXVColorSystem@pvt@2@Vustring@OpenImageIO_v2_4@@1U?$Masked@V?$Color3@M@Imath_2_4@@$07@2@U?$Wide@$$CBV?$Color3@M@Imath_2_4@@$07@2@PEAVShadingContext@2@@Z)
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class OpenImageIO_v2_4::ustring const OSL_v1_12::Strings::XYZ" (__imp_?XYZ@Strings@OSL_v1_12@@3Vustring@OpenImageIO_v2_4@@B) referenced in function "void __cdecl OSL_v1_12::b8_AVX_pvt::`anonymous namespace'::wide_transformc >(class OSL_v1_12::pvt::ColorSystem,class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,struct OSL_v1_12::Masked,8>,struct OSL_v1_12::Wide const ,8>,class OSL_v1_12::ShadingContext *)" (??$wide_transformc@V?$Color3@M@Imath_2_4@@@?A0x24e98508@b8_AVX_pvt@OSL_v1_12@@YAXVColorSystem@pvt@2@Vustring@OpenImageIO_v2_4@@1U?$Masked@V?$Color3@M@Imath_2_4@@$07@2@U?$Wide@$$CBV?$Color3@M@Imath_2_4@@$07@2@PEAVShadingContext@2@@Z)
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class OpenImageIO_v2_4::ustring const OSL_v1_12::Strings::xyY" (__imp_?xyY@Strings@OSL_v1_12@@3Vustring@OpenImageIO_v2_4@@B) referenced in function "void __cdecl OSL_v1_12::b8_AVX_pvt::`anonymous namespace'::wide_transformc >(class OSL_v1_12::pvt::ColorSystem,class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,struct OSL_v1_12::Masked,8>,struct OSL_v1_12::Wide const ,8>,class OSL_v1_12::ShadingContext *)" (??$wide_transformc@V?$Color3@M@Imath_2_4@@@?A0x24e98508@b8_AVX_pvt@OSL_v1_12@@YAXVColorSystem@pvt@2@Vustring@OpenImageIO_v2_4@@1U?$Masked@V?$Color3@M@Imath_2_4@@$07@2@U?$Wide@$$CBV?$Color3@M@Imath_2_4@@$07@2@PEAVShadingContext@2@@Z)
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class OpenImageIO_v2_4::ustring const OSL_v1_12::Strings::linear" (__imp_?linear@Strings@OSL_v1_12@@3Vustring@OpenImageIO_v2_4@@B) referenced in function "void __cdecl OSL_v1_12::b8_AVX_pvt::`anonymous namespace'::wide_transformc >(class OSL_v1_12::pvt::ColorSystem,class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,struct OSL_v1_12::Masked,8>,struct OSL_v1_12::Wide const ,8>,class OSL_v1_12::ShadingContext *)" (??$wide_transformc@V?$Color3@M@Imath_2_4@@@?A0x24e98508@b8_AVX_pvt@OSL_v1_12@@YAXVColorSystem@pvt@2@Vustring@OpenImageIO_v2_4@@1U?$Masked@V?$Color3@M@Imath_2_4@@$07@2@U?$Wide@$$CBV?$Color3@M@Imath_2_4@@$07@2@PEAVShadingContext@2@@Z)
wide_opcolor_b8_AVX.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class OpenImageIO_v2_4::ustring const OSL_v1_12::Strings::sRGB" (__imp_?sRGB@Strings@OSL_v1_12@@3Vustring@OpenImageIO_v2_4@@B) referenced in function "void __cdecl OSL_v1_12::b8_AVX_pvt::`anonymous namespace'::wide_transformc >(class OSL_v1_12::pvt::ColorSystem,class OpenImageIO_v2_4::ustring,class OpenImageIO_v2_4::ustring,struct OSL_v1_12::Masked,8>,struct OSL_v1_12::Wide const ,8>,class OSL_v1_12::ShadingContext *)" (??$wide_transformc@V?$Color3@M@Imath_2_4@@@?A0x24e98508@b8_AVX_pvt@OSL_v1_12@@YAXVColorSystem@pvt@2@Vustring@OpenImageIO_v2_4@@1U?$Masked@V?$Color3@M@Imath_2_4@@$07@2@U?$Wide@$$CBV?$Color3@M@Imath_2_4@@$07@2@PEAVShadingContext@2@@Z)
```
### Steps to Reproduce
1. Build with MSVC 2019
2. Add `-D USED_BATCHED=b8_AVX` build flag
### Versions
* OSL branch/version: 1.12.9.0
* OS: Windows 10
* C++ compiler: MSVC 2019
* LLVM version: 11.1.0
* OIIO version: 2.4.8.0
Contributor guide
Research direction
Reproduce the Windows build with MSVC 2019, LLVM 11.1.0, OIIO 2.4.8.0, and the `USED_BATCHED=b8_AVX` flag. Inspect the Windows batched-build and linker configuration to determine why the reported OSL symbols are unresolved; done means the build completes successfully without those linker errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100