libpqxx: \array-composite.hxx(236): error C2440: '': cannot convert from 'const _Elem' to 'std::string'

Hello there! I’m having a problem building your simple example program, starting with version 7.2.0. I’m using Visual Studio 2017. The line pqxx::connection c{"postgresql://accounting@localhost/company"}; gives the following problem:

1>c:\development\libpqxx\bin\include\pqxx\internal\array-composite.hxx(236): error C2440: '<function-style-cast>': cannot convert from 'const _Elem' to 'std::string'
1>        with
1>        [
1>            _Elem=char
1>        ]
1>c:\development\libpqxx\bin\include\pqxx\internal\array-composite.hxx(236): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>Done building project "pqxxtest.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Is there something I can do to fix this?

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

I’ve opened a ticket for Visual Studio, which you can follow here: https://developercommunity2.visualstudio.com/t/1286797

There is no solution as of yet.

Okay, it work’s with Visual Studio 2019.