1

I am building a C++ source code in visual studio 2013. My source code is accessing libjpeg. So when I am trying to build the code I am getting the following error:

"fatal error: cannot open file 'libjpeg_d.lib'".

I even install "libjpeg" package using package manager using command "Install-Package libjpeg"

Can anyone help me to resolve this issue?

Thanks

ishan jain
  • 681
  • 3
  • 10
  • 27

2 Answers2

1

You may need to set the /LIBPATH to the directory containing libjpeg.
https://msdn.microsoft.com/en-us/library/1xhzskbe.aspx

The "_d" may indicate you need the debug version of libjpeg. Try to download this one too and don't forget to add the path to /LIBPATH.

mblaettler
  • 31
  • 3
  • I have set the /LIBPATH to "D:\Ishan\VerifoneSDK\gui-viewer\gui\gui_viewer\packages\libjpeg.9.0.1.3\build\native\lib\v110\Win32\Debug". But still it is giving the same error. Is there any other debug version for this library and if it is then please provide the link. – ishan jain Jul 01 '15 at 13:11
  • Does your path contain a file called "libjpeg_d.lib"? Have you built libjpeg on your computer? – mblaettler Jul 01 '15 at 13:13
  • No, The problem is nuget libjpeg package doesnot contain "libjpeg_d.lib" file. Can you tell where can I find this file? – ishan jain Jul 01 '15 at 13:14
  • Unfortunately I don't have a visual studio environment set up on my laptop. What kind of files does the folder contain? You may have to build the debug library first. Just check your libjpeg.9.0.1.3 folder whether there's a vc-solution or vc-project available. – mblaettler Jul 01 '15 at 13:46
  • What kind of files does your folder contain? Are there any *.lib or *.dll files? – mblaettler Jul 01 '15 at 14:05
  • Nuget downloaded libjpeg.redist.9.0.1.3 package, which contains "jpeg.dll" file at "D:\Ishan\VerifoneSDK\gui-viewer\gui\gui_viewer\packages\libjpeg.redist.9.0.1.3\build\native\bin\v110\x64\Debug\dynamic\cdecl\jpeg.dll". – ishan jain Jul 01 '15 at 14:16
  • It also contains "jpeg.lib" file at "D:\Ishan\VerifoneSDK\gui-viewer\gui\gui_viewer\packages\libjpeg.9.0.1.3\build\native\lib\v110\x64\Debug\dynamic\cdecl\jpeg.lib" – ishan jain Jul 01 '15 at 14:17
  • Try to use the jpeg.lib by following [this guide](http://stackoverflow.com/questions/4445418/how-to-add-additional-libraries-in-c) and add "D:\Ishan\VerifoneSDK\gui-viewer\gui\gui_viewer\packages\libjpeg.9.0.1.3\build\n‌​ative\lib\v110\x64\Debug\dynamic\cdecl\jpeg.lib" to your /LIBPATH – mblaettler Jul 01 '15 at 14:44
0

The file might be corrupt, try downloading it again or you don't have the correct permissions assigned to the file.

Hope these suggestions help.

mparkuk
  • 509
  • 7
  • 14