Hello -

When I try to use static OIIO library it throws LNK2001 error. The problem 
exists no matter if I build the library myself or use vcpkg.

auto

 img = 

OIIO

::

ImageInput

::

open

(filename);

error LNK2001: unresolved external symbol "__declspec(dllimport) public: static 
class std::unique_ptr<class OpenImageIO_v2_1::ImageInput,struct 
std::default_delete<class OpenImageIO_v2_1::ImageInput> > __cdecl 
OpenImageIO_v2_1::ImageInput::open(class std::basic_string<char,struct 
std::char_traits<char>,class std::allocator<char> > const &,class 
OpenImageIO_v2_1::ImageSpec const *)" 
(__imp_?open@ImageInput@OpenImageIO_v2_1@@SA?AV?$unique_ptr@VImageInput@OpenImageIO_v2_1@@U?$default_delete@VImageInput@OpenImageIO_v2_1@@@std@@@std@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@4@PEBVImageSpec@2@@Z)

I tried adding the following code to CMakeFiles.txt, but with no success.

if (WIN32)
    add_definitions ("-DOpenImageIO_EXPORTS")
endif ()

Does anyone have any ideas how to solve this?
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to