Skip to content

Windows MSVC 2019 EXV_ICONV_CONST undefined #1250

Closed
@tester0077

Description

@tester0077

Compiling the code form a newly cloned version from Github, (expected/intended to be 0.27-maintenance) under MSVC 2019 for a 32-bit version of Exiv2:
In convert.cpp the line
EXV_ICONV_CONST char* inptr = const_cast<char*>(str.c_str());

the line shown, causes the error:
1>convert.cpp
1>D:\pkg\C++\MSVC2019\exiv2Git\exiv2\src\convert.cpp(1527,25): error C2664: 'size_t libiconv(libiconv_t,const char **,size_t *,char **,size_t *)': cannot convert argument 2 from 'char **' to 'const char **'
1>D:\pkg\C++\MSVC2019\exiv2Git\exiv2\src\convert.cpp(1528,31): message : Conversion loses qualifiers
1>C:\gnuwin32\include\iconv.h(92,37): message : see declaration of 'libiconv'

This error causes most of the other sub-projects to also fail.
Replacing EXV_ICONV_CONST with a plain 'const' allow this file to compile cleanly as well as all of the rest.

The sln file was created following the instructions for Windows MSVC compile https://github.com/Exiv2/exiv2/blob/master/README-CONAN.md

At this stage I have no idea about the version of libiconv, but the entire setup was presumably vetted by the conan install & update process.

Searching for the string "EXV_ICONV_CONST" does not show any instance except the line giving the error, implying that for the current setup it is not defined

Desktop (please complete the following information):

  • OS: Windows 10, 64-bit
  • Compiler & Version MSVC 2019
  • Compilation mode and/or compiler flags

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CMakeConfiguration issues related with CMake

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions