使用vs2015编译器编译libpqxx时发生的错误以及解决办法

d:\libpqxx-4.0\libpqxx-4.0\src\strconv.cxx(195): error C2440: “=”: 无法从“std
::basic_istream<char,std::char_traits<char>>”转换为“bool”
d:\libpqxx-4.0\libpqxx-4.0\src\strconv.cxx(195): note: 没有可用于执行该转换的用
户定义的转换运算符,或者无法调用该运算符
d:\libpqxx-4.0\libpqxx-4.0\src\strconv.cxx(468): note: 参见对正在编译的函数 模板
实例化“void `anonymous-namespace'::from_string_float<float>(const char [],T &)
”的引用
with
[
T=float
]
NMAKE : fatal error U1077: “"D:\Program Files (x86)\Microsoft Visual Studio 14.
0\VC\BIN\cl.exe"”: 返回代码“0x2”
Stop.

以上错误主要是在strconv.cxx中195行所在的函数,ok赋值时没有从char类型转为bool类型,因此增加一次强转就可以了。

  default:
    if (Str[0] == '-' && valid_infinity_string(&Str[1]))
    {
      ok = true;
      set_to_Inf(result, -1);
    }
    else
    {
      stringstream S(Str);
#if defined(PQXX_HAVE_IMBUE)
      S.imbue(locale("C"));
#endif
      ok =(bool) (S >> result);
    }
    break;
  }

 

转载于:https://www.cnblogs.com/zhangdewang/p/9704969.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值