Are you building with EMBEDPLUGINS on?

We also used 
if (WIN32)
    add_definitions ("-DOpenImageIO_EXPORTS")
endif ()

In our CMakeLists.txt that includes OIIO to make sure OIIO_API was correctly 
set in exports.h. 

I’m not to sure if this is set anywhere else. 

Colin

> On Jul 10, 2019, at 4:35 PM, kdawlud <[email protected]> wrote:
> 
> Hello -
> 
> I want to use OIIO in 3ds max plugin. I have managed to build dynamic OIIO 
> library, which works correctly, but obviously it depends on other .dll's 
> which I would have to include when distributing the plugin. Ideally I want to 
> deliver the plugin as one file with no dependencies required. For this 
> purpose, I'm trying to build static OIIO library, which builds successfully, 
> but when used, it gives me LNK2001 e.g. when OIIO::ImageInput::open(filename) 
> is called:
> 
> 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 have checked the library with dumpbin and I can see the mentioned symbol is 
> present (unless I'm missing something here).
> 
> dumpbin.exe /headers OpenImageIO.lib | findstr OpenImageIO_v2_1::ImageInput
> 
> Are there some specific options that I need to set when building static 
> version? 
> I attached CMakeCache. Let me know if you need more information.
> 
> Best Regards,
> Chris
> <CMakeCache.txt>_______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to