Compiling v0.20 x64 in Visual Studio 2012
Hi I am trying to compile Exiv2 to a 64b static library in Visual Studio 2012 and get this error:
C:\Projects\Exiv2 0.20\basicio.cpp(655): error C2039: 'chmod' : is not a member of '`global namespace''
C:\Projects\Exiv2 0.20\basicio.cpp(655): error C3861: 'chmod': identifier not found
Has anyone come across this or have any ideas about work-arounds?
Thanks for bringing this to my attention. I'll be honest and admit that I don't really support Visual Studio 2012 yet. I did build exiv2 with the Developer Preview, however I haven't had time to work with the shipping version.
I Googled "chmod Visual Studio 2012" and discovered this:
Which states: "This POSIX function is deprecated. Use the ISO C++ conformant _chmod instead."
The fix is to add code to exv_msvc.h like this:
#if _MSC_VER >= 1700
#define chmod _chmod
You can add this to basicio.cpp, or (better) to exv_msvc.h
Take Care: There are several copies of exv_msvc.h in the build tree. Please update them all. And do a build/clean before building.
It's quite likely that there are other issues with 2012 of a similar nature. If you build the trunk, I will be happy to accept (and test) a patch from you.
It seems that this was due to an option that was set by default in my project that treated warnings as errors; after changing that it built just fine. Thanks though :D
Yes. I treat warnings as errors. Switching that off is another solution - as you have discovered. I see you're building 0.20 which was published long before Visual Studio 2012. Thanks very much for updating the forum as that will probably help somebody else one day.
I'm working at the moment to create the 0.24 version of Exiv2 and the code above will be included. I hope to build and test exiv2 0.24 with Visual Studio 2012 Express Edition.
When do you think 0.24 will be ready? In another application I am going to be adding 0.23 for it's video metadata abilities but if 0.24 is going to be out soon I'd rather use that.
I hope it will be by the end of July. It's in good shape. It builds and passes the test suite on all supported platforms: Mac/Linux/Cygwin (./configure and CMake) and msvc and msvc64. I have to review all the bugs and documentation. I'm home on sabbatical at present, so I'm working full-time for Exiv2 at the moment. I'm leaving for England on July 30 and hope it'll be "out the door" by then.
More information about our plans.
Our Video meta-data code was added last Summer by Abhinav as a Google Summer of Code 2012 Project. It provides read access in 4 formats. Abhinav is mentoring Mahesh this summer to add write video support and add read/write support for extra formats (QuickTime, I think).
The 0.24 release will have Abhinav's read support for 4 video formats (and lot of other stuff and fixes.).
I hope to have 0.25 release at the end of 2013 and to include Mahesh's video write, and QuickTime read/write support.
I'm mentoring our other GSoC13 project. Tuan has done a splendid job to add remote protocol support to the library (http/https/ftp/sftp/ssh/stdin/file/data) and that will also be included in 0.25. http://dev.exiv2.org/projects/exiv2/wiki/GSoC_2013_%22Cloud_Ready%22_Project_Specification