RenderKit / oidn

Intel® Open Image Denoise library
https://www.openimagedenoise.org/
Apache License 2.0
1.77k stars 164 forks source link

Link error using DeviceRef #48

Closed flaviu22 closed 4 years ago

flaviu22 commented 4 years ago

I have included the following code in a VC++/MFC project:

#include "OpenImageDenoise/oidn.hpp"
#include "image_io.h"

#pragma comment(lib, "Ref/oidn-1.1.0.x64.vc14.windows/lib/OpenImageDenoise.lib")

    ImageBuffer color;
    oidn::loadImage(_T("D:\\Tempx\\memorial.pfm"));
    const int width = color.getWidth();
    const int height = color.getHeight();
    // Initialize the output image
    ImageBuffer output(width, height, 3);
    oidn::DeviceRef device = oidn::newDevice();

and when I compile this code, I get the following error:

error LNK2019: unresolved external symbol __imp__oidnNewDevice referenced in function "class oidn::DeviceRef __cdecl oidn::newDevice(enum oidn::DeviceType)" (?newDevice@oidn@@YA?AVDeviceRef@1@W4DeviceType@1@@Z)
error LNK2019: unresolved external symbol __imp__oidnReleaseDevice referenced in function "public: __thiscall oidn::DeviceRef::~DeviceRef(void)" (??1DeviceRef@oidn@@QAE@XZ)

What I should do more to can compile a simple sample for this library ?

flaviu22 commented 4 years ago

Must be compiled on 64bit, that was the problem. Solved.