expected expression before')'token
如上图所示,今天遇到的一个编译问题,明明用法跟其他地方的一摸一样,在主程序里编译就没问题,动态库里死活都编译不过去,可把我折磨死了,最后没办法,只能请教大佬,大佬过来几分钟就找到了问题,真正出错的地方并不是报error的地方,而是截图中圈红的地方,最后发现是编译选项出的问题,果然一看主程序里面编译选项是-std=gnu99,动态库里编译选项却是-std=c99,原因就出来了 下面给出解决方案:
warning: implicit declaration of function ‘typeof’
错误提示缺少')';
修改方法:
__asm__/__inline__/__typeof__
就可以解决该问题;
或者在gcc的编译参数中去掉std=c99编译选项,改成-std=gnu99.
最后编译通过。
个人总结:为什么大佬可以解决这种问题,但是自己却解决不了,一个是经验问题,还有一个更重要的就是对数据的敏感度,出现这个问题我一直盯着error看,但其实真正原因是圈红线的地方导致后面出现错误,所以距离一个优秀的程序员任重而道远,唯有总结经验,砥砺前行,学习大佬们的思维模式,对任何数据都保持怀疑态度,才会在这条路上越走越远!!!
expected expression before')'token的更多相关文章
- C和指针 第十二章 结构体 整体赋值 error: expected expression
定义结构体后整体赋值时发生错误 typedef struct NODE { struct NODE *fwd; struct NODE *bwd; int value; } Node; //声明变量 ...
- 坑备忘error: expected class-name before '{' token
今日重构之前的代码,修改了命名空间,然后一处派生的子类定义处总是总是报error: expected class-name before '{' token,网上查了查原因,出现这种情况大致有两种情况 ...
- Error: expected expression, got '}'
1.错误描述 Error: expected expression, got '}' .globalEval/<@http://localhost:8080/Sys/resource/globa ...
- g++报错原因分析:expected class-name before ‘{’ token
今天写程序的时候, 遇到这样一个错误expected class-name before ‘{’ token 最后发现原来是我的头文件声明没有加. 继承时不要忘记加基类的头文件 错误: class F ...
- error: expected expression before ‘struct
Linux C/C++编程时常会遇到“error: expected expression before ‘struct’”错误,此错误一般是由未定义的宏(宏里套宏)或参量引起,导致编译器判断当前语句 ...
- expected expression __bridge
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u013020103/article/details/30491117 expected expres ...
- SyntaxError: expected expression, got '<'异常错误
引入jQuery文件,浏览器报SyntaxError: expected expression, got '<'错误,但是jQuery文件可以在网络一栏看到,最后检查是springMVC定义的拦 ...
- 错误解决:error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token
今天看到一个比较有趣的题目,如下代码,分析输出结果 #include <stdio.h> void num(int &b) { b = 222; return; } int mai ...
- 前端控制台 JavaScript函数报错 SyntaxError: expected expression, got ';' SyntaxError: expected expression, got 'if'
在火狐浏览器下调试时, 页面报错SyntaxError: expected expression, got ';'或者SyntaxError: expected expression, got 'if ...
- JavaScript函数报错SyntaxError: expected expression, got ';'
故事背景:编写Javaweb项目,在火狐浏览器下运行时firebug报错SyntaxError: expected expression, got ';'或者SyntaxError: expected ...
随机推荐
- 20230225 TI Electromagnetic compatibility testing methods and standards
Hello, and welcome to the TI Precision Labs video, Introducing Electromagnetic Compliance Standard T ...
- KMS服务器 激活win 和 office
环境:Debian 9.5 (Google Cloud) 切换到root用户:sudo su wget --no-check-certificate https://github.com/teddys ...
- Intel oneAPI 环境变量设置
因工作需要,需要在linux系统配置多个不同环境的库,需要使用environment-modules工具管理环境变量,为保持配置方法的一致性,也使用modulefile文件加载Intel oneAPI ...
- gitee 上传远程仓库失败
1:添加本地id_rsa.pub文件内容到gitee SSH Keys (添加公开密钥) 2:设置本地的邮箱和用户名 git config --global user.name "MARS& ...
- spring-cloud项目初始化问题
无法引入本地依赖 参考:https://blog.csdn.net/qq_39684784/article/details/115289982 时区问题: url设置:serverTimezone=U ...
- ubuntu启动盘制作
转自https://www.cnblogs.com/silentdoer/p/13044305.html 1. 从Ubuntu官网http://cn.ubuntu.com/download/下载系统的 ...
- Dynamics 365 如何代表其他用户发送邮件
举个例子,用户A和用户B,用户B在新建电子邮件时,发件人以用户A的身份去发送邮件,这个时候需要做如下配置才可以. 首先登录用户A,在高级设置->个人设置中,配置允许其他人代表自己发送电子邮件. ...
- C++future promise
A future is an object that can retrieve a value from some provider object or function, properly sync ...
- 公式b-(a-b)
- google filament pbr
https://google.github.io/filament/Filament.md.html