Project

General

Profile

Compiling v0.20 x64 in Visual Studio 2012

Added by Michael McGrath about 6 years ago

Hi I am trying to compile Exiv2 to a 64b static library in Visual Studio 2012 and get this error:
basicio.cpp
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


Replies (6)

RE: Compiling v0.20 x64 in Visual Studio 2012 - Added by Robin Mills almost 6 years ago

Michael

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:
http://msdn.microsoft.com/en-us/library/ms235458.aspx

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:
#ifdef _MSC_VER
// http://msdn.microsoft.com/en-us/library/ms235458.aspx
#if _MSC_VER >= 1700
#define chmod _chmod
#endif
#endif

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.

Robin

RE: Compiling v0.20 x64 in Visual Studio 2012 - Added by Michael McGrath almost 6 years ago

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

RE: Compiling v0.20 x64 in Visual Studio 2012 - Added by Robin Mills almost 6 years ago

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.

Robin

RE: Compiling v0.20 x64 in Visual Studio 2012 - Added by Michael McGrath almost 6 years ago

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.

RE: Compiling v0.20 x64 in Visual Studio 2012 - Added by Robin Mills almost 6 years ago

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.

Robin

RE: Compiling v0.20 x64 in Visual Studio 2012 - Added by Robin Mills almost 6 years ago

Michael

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

Robin

    (1-6/6)