g++编译 error: expected class-name before ‘{’ token

解决库冲突与编译难题
  1. 网上的帖子的原因,没有找到适合我的。
    最后把头文件重命名,解决问题。
    分析: 该头文件名可以和boost等库中头文件重名,导致没找到相关类

debug耗时:1.5h

  1. 前天报错内容忘记了,解决办法: 调换动态库的加载顺序
    debug耗时:2.5h

fuck
天天光编译就浪费很多时间

main.cpp: In function ‘void printStatus(const GatewayManager&)’: main.cpp:38:22: error: expected unqualified-id before ‘[’ token for (const auto& [id, status] : input_status) { ^ main.cpp:38:22: error: expected ‘;’ before ‘[’ token main.cpp:38:23: error: ‘id’ was not declared in this scope for (const auto& [id, status] : input_status) { ^ main.cpp:38:27: error: ‘status’ was not declared in this scope for (const auto& [id, status] : input_status) { ^ main.cpp: In lambda function: main.cpp:38:35: error: expected ‘{’ before:token for (const auto& [id, status] : input_status) { ^ main.cpp: In function ‘void printStatus(const GatewayManager&)’: main.cpp:38:35: error: expected ‘;’ before:token main.cpp:38:35: error: expected primary-expression before:token main.cpp:38:35: error: expected ‘)’ before:token main.cpp:38:35: error: expected primary-expression before:token main.cpp:38:35: error: expected ‘;’ before:token main.cpp:45:22: error: expected unqualified-id before ‘[’ token for (const auto& [id, status] : output_status) { ^ main.cpp:45:22: error: expected ‘;’ before ‘[’ token main.cpp:45:23: error: ‘id’ was not declared in this scope for (const auto& [id, status] : output_status) { ^ main.cpp:45:27: error: ‘status’ was not declared in this scope for (const auto& [id, status] : output_status) { ^ main.cpp: In lambda function: main.cpp:45:35: error: expected ‘{’ before:token for (const auto& [id, status] : output_status) { ^ main.cpp: In function ‘void printStatus(const GatewayManager&)’: main.cpp:45:35: error: expected ‘;’ before:token main.cpp:45:35: error: expected primary-expression before:token main.cpp:45:35: error: expected ‘)’ before:token main.cpp:45:35: error: expected primary-expression before:token main.cpp:45:35: error: expected ‘;’ before:token 错误原因
最新发布
10-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值