error: '__builtin_bswap32' was not declared in this scope
来源:互联网 发布:李叫兽真的是大神知乎 编辑:程序博客网 时间:2024/06/15 23:21
最近做代码移植时,出现 error: '__builtin_bswap32' was not declared in this scope 的问题。
大概的解决思路是:
1.使用“gcc --version”查看gcc版本,确认gcc >= 4.2;
2. 由于该函数属于gcc内建函数,通过测试确认在当前环境下该函数可用;
3. 该函数定义外部声明在“gccxml_builtins.h”中,查看其中是否存在该函数的定义。(一般情况下,可以查看./gccxml-0.9目录下,是否包含了当前系统下的所有gcc版本的文件夹,出现该问题的时候一般是没有包含的)如果没有,则下载安装gccxml.
具体操作步骤参考: http://cache.baiducontent.com/c?m=9f65cb4a8c8507ed4fece763105392230e54f73d678b975f298fd81c84642c101a39feff7c755557938327365ff85e5c9db26c30200254eccddf893cdeb996282e8c33712d5cd04e478248b8ca366f9e7e875a98b86894ad813784afa2c4ae2744ba53120b81e7fb5c&p=82769a4796934eaf58edde3a174081&newp=c478c64ad49c06bc44bd9b7e0d169f231610db2151d6d0156b82c825d7331b001c3bbfb423241302d1c07d6400aa485eeef23479330123a3dda5c91d9fb4c57479d760276c&user=baidu&fm=sc&query=gccxml+%CA%C7%CA%B2%C3%B4&qid=aefaefaa000aa32f&p1=5
在该cmake过程中可能出现错误:“gccxml is now removed...”, 原因是在cmakelists.txt使用中message(FATAL ERROR, "XXX"),用于强制告知用户gccxml已经移动了的消息,批注掉该部分就能继续cmake了。
4.安装完成之后,应该在“/usr/local/share/gccxml-0.9”目录下看到当前系统中的所有gcc版本对应的文件夹了。如果依旧出现该错误,则将所有文件夹中“gccxml_builtins.h”中的“#ifdef __llvm_”批注掉,即可解决该问题。
原因参考:https://github.com/gccxml/gccxml/commit/babff070
- error: '__builtin_bswap32' was not declared in this scope
- error: '_localtime_not_threadsafe_' was not declared in this scope
- error: ‘exit’ was not declared in this scope
- error: `cout' was not declared in this scope
- error: 'UINT64_C' was not declared in this scope
- error: 'memcpy' was not declared in this scope
- error: 'memcpy' was not declared in this scope的解决
- error: ‘BYTE’ was not declared in this scope
- error: ‘closesocket’ was not declared in this scope
- error:inet_addr() was not declared in this scope
- error: ‘exit’ was not declared in this scope 的解决方法
- 关于error: ‘htons’ was not declared in this scope
- error: ‘memcpy’ was not declared in this scope 解决
- error: ‘alarm’ was not declared in this scope 解决
- error: ‘ostream_iterator’ was not declared in this scope
- error: 'glGenFramebuffersOES' was not declared in this scope
- error: 'LOGE' was not declared in this scope
- error: 'ff_get_buffer' was not declared in this scope
- 非常可乐 (广搜(简单倒水问题))
- FIR滤波器设计(Kaiser窗案例)
- linux之dup和dup2函数解析
- MTK平台tear现象排查
- @Controller和@RestController的区别?
- error: '__builtin_bswap32' was not declared in this scope
- c实现 深搜 南阳20 吝啬的国度
- 经典SQL语句大全
- 《大话设计模式》之大总结
- Recyclerview的一些个人理解与使用(四)在界面中实现侧边栏效果
- java
- wampserver 访问 403 解决办法
- Python 协程
- java堆栈,基本数据存储方式和Integer缓存造成的小小问题