exiv0.26 with VS2015 Professional

Added by Haider Ali 22 days ago

Hi all!

I am fairly new to C++ and Exiv2. I am trying to include Exiv in my Visual Studio 2015 Professional application using pre-built binaries downloaded from [[http://www.exiv2.org/builds/exiv2-0.26-msvc.tar.gz]].

  1. I have added the path C:\dist\2015\x64\dll\Release\bin to System variables.
  2. In Visual Studio 2015, I have added the path C:\dist\2015\x64\dll\Release\include to "Additional Include Directories" in C/C++-->General.
  3. I have added the path C:\dist\2015\x64\dll\Release\lib to "Additional Library Directories" in Linker-->General.
  4. I have added the libs namely exiv2.lib, expat.lib, xmp.lib, zlib.lib, zlibstatic.lib in "Additional Dependencies" in Linker-->Input.

There are no build errors but when I try to run the program, it gives an error that this visual studio solution has stopped working. Can anyone please tell me what am I doing wrong?
Thank you

P.S. When I run exiv2.exe from command line in folder C:\dist\2015\x64\dll\Release\bin, it's working fine.


Replies (6)

RE: exiv0.26 with VS2015 Professional - Added by Robin Mills 22 days ago

I don't know what's wrong. Is it possible to screen share on Skype and we can discuss this one-to-one. I'm on vacation at the moment and will be home on Wednesday next week. I think you should copy the DLLs (expat, zlib and exiv2) into the directory into which you are building yourapp.exe.

RE: exiv0.26 with VS2015 Professional - Added by Haider Ali 21 days ago

I have tried your suggestion of copying the DLLs but same problem.

Yes that would be great if you can help me sort it out over Skype.

RE: exiv0.26 with VS2015 Professional - Added by Robin Mills 21 days ago

We can talk on Thursday. I'm in England. My Skype name is clanmills

If you want to send me your project, I'll take a look at it on my laptop which has Visual Studio 2017 Community Edition while I'm on vacation. Zip your stuff together and use a web services with which you can send a "one off" file. The web service will send me an email with a one-off password to download your code.

RE: exiv0.26 with VS2015 Professional - Added by Haider Ali 21 days ago

Okay I will send you the Visual Studio 2015 Professional project files.

Thanks.

RE: exiv0.26 with VS2015 Professional - Added by Robin Mills 18 days ago

Haider

Good News. I've reproduced your situation and I have your code working "straight out of the box" (for Release/DLL).

1) I downloaded and installed VS 2015 Community Edition.

2) I've downloaded and unzipped http://www.exiv2.org/builds/exiv2-0.26-msvc.tar.gz into c:\dist

3) I unrared your files into c:\temp\testEXIV and built your code. Builds. Visual Studio Debug/Start Debugging (F5). Crashes in exiv2.dll I changed your input file to a file on my machine c:\\temp\\Stonehenge.jpg Still Crashes. Ummm could it be a release/debug conflict? I think MSVC debug code requires debug DLLs.

4) Update your project to x64/Release

Visual Studio Project/Properties (Alt-F7)
C/C++ General: Additional Include Directories: C:\dist\2015\x64\dll\Release\include;%(AdditionalIncludeDirectories)
Linker: General: Additional Library Directories: C:\dist\2015\x64\dll\Release\lib
Linker: Input: Additional Dependencies: exiv2.lib;%(AdditionalDependencies)

Build Build/BuildSolution F7

Copy the DLLs to the build directory
DOS:

> cd C:\dist\2015\x64\dll\Release\bin
> copy *.dll c:\temp\testEXIV2\x64\Release

Program can now run Visual Studio (Debug/Start without Debugging)
Or from DOS:

> cd c:\temp\testEXIV2\x64\Release
> testEXIV2

Comment
I am a little surprised by this. I think a debug build of your code requires a debug build of the libraries. I'm not sure why and that's a question for Microsoft. Perhaps debug/release builds use different run-time libraries or something.

RE: exiv0.26 with VS2015 Professional - Added by Haider Ali 18 days ago

Hi Robin,

Thank you very very much for the reply. It was just a matter of Debug vs Release setting in Visual Studio. I updated my project files to Release/x64 and it worked.

Thank you for taking out the time. Really appreciate it.

Regards,
Haider

(1-6/6)

Redmine Appliance - Powered by TurnKey Linux