Add new comment

Linking Libraw to VS project

I was able to compile the Libraw .lib, .dll, and examples programs successfully. I've tested the sample programs and they work. However, now I'm trying to link the library into a Visual Studio 2013 project I'm working on and can't figure out why it's not working.
Under Linker->Input->Additional Dependencies, I've added the path to the lib/libraw.lib file. At the top of my code I've also added a #include <libraw.h> and in C/C++->General->Additional Include Directories I've added the path to the LibRaw-0.16.2/libraw folder.
But when I try to compile it can't find the definitions for the functions I'm trying to use:

Error	1	error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl LibRaw::LibRaw(unsigned int)" (__imp_??0LibRaw@@QEAA@I@Z) referenced in function "int __cdecl runDepthFromFocus(int,char * * const)" (?runDepthFromFocus@@YAHHQEAPEAD@Z)	C:\Users\Matteo\Desktop\GSFF_MV_Build\src\matteo\depthFromFocus.obj	Matteo
Error	2	error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl LibRaw::open_file(wchar_t const *,__int64)" (__imp_?open_file@LibRaw@@QEAAHPEB_W_J@Z) referenced in function "int __cdecl runDepthFromFocus(int,char * * const)" (?runDepthFromFocus@@YAHHQEAPEAD@Z)	C:\Users\Matteo\Desktop\GSFF_MV_Build\src\matteo\depthFromFocus.obj	Matteo
Error	3	error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl LibRaw::dcraw_ppm_tiff_writer(char const *)" (__imp_?dcraw_ppm_tiff_writer@LibRaw@@QEAAHPEBD@Z) referenced in function "int __cdecl runDepthFromFocus(int,char * * const)" (?runDepthFromFocus@@YAHHQEAPEAD@Z)	C:\Users\Matteo\Desktop\GSFF_MV_Build\src\matteo\depthFromFocus.obj	Matteo
Error	4	error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl LibRaw::~LibRaw(void)" (__imp_??1LibRaw@@UEAA@XZ) referenced in function "int __cdecl runDepthFromFocus(int,char * * const)" (?runDepthFromFocus@@YAHHQEAPEAD@Z)	C:\Users\Matteo\Desktop\GSFF_MV_Build\src\matteo\depthFromFocus.obj	Matteo
Error	5	error LNK1120: 4 unresolved externals	C:\Users\Matteo\Desktop\GSFF_MV_Build\src\matteo\RelWithDebInfo\Matteo.exe	1	1	Matteo

Forums: