g++ error: expected ‘)’ before ‘*’ token
原本*号前面的类型是我用typedef自定义的类型的,MyType* const p;
发生这样的错误是,编译器根本不知道MyType是什么东西,这是我在C++多重继承中遇到的。MyType是我在基类中public中定义的类型,结果在它的孙子类发生出这样的情况,不识别这个新类型。但是儿子类中也有MyType类型,却没有报错。
在孙子类中根据基类重新typedef下MyType就好了,编译器就能识别次类型了。
reference:
http://stackoverflow.com/questions/3720034/error-expected-before-token
g++ error: expected ‘)’ before ‘*’ token的更多相关文章
- g++ error: expected nested-name-specifier before 'XXX'
template <typename addrT=int,typename valuT=int,typename stream_addrT=bm_addr,typename stream_siz ...
- 坑备忘error: expected class-name before '{' token
今日重构之前的代码,修改了命名空间,然后一处派生的子类定义处总是总是报error: expected class-name before '{' token,网上查了查原因,出现这种情况大致有两种情况 ...
- error: expected constructor, destructor, or type conversion before '.' token
今天写代码是遇到这样一个问题error: expected constructor, destructor, or type conversion before '.' token:立马网上查,原来是 ...
- 错误解决:error: expected ‘;’, ‘,’ or ‘)’ before ‘&’ token
今天看到一个比较有趣的题目,如下代码,分析输出结果 #include <stdio.h> void num(int &b) { b = 222; return; } int mai ...
- Centos 7 成功安装 dosbox 解决 "error: expected primary-expression before ‘,’ token" 错误
dosbox-0.74 bug 修复版下载: http://download.csdn.net/detail/yangbodong22011/9663271 注意:这篇博客解决了下面这个问题,如果你也 ...
- linux shell-syntax error near unexpected token错误
在windows下用记事本编写linux shell脚本后,执行遇到syntax error near unexpected token错误 问题原理:网上找了好久,找到原因,原来是回行的问题,每个系 ...
- Error: expected expression, got '}'
1.错误描述 Error: expected expression, got '}' .globalEval/<@http://localhost:8080/Sys/resource/globa ...
- Error_Unix Shell_syntax error near unexpected token `fi'
2014-06-19 BaoXinjian 1. Issue 调用如下Shell脚本时出现错误syntax error near unexpected token `fi'
- 关于报错“syntax error near unexpected token `”和回车换行
本来是很简单一个事情,转过来是因为打字机这事比较有趣…… http://blog.csdn.net/xyp84/archive/2009/08/11/4435899.aspx 摘要一下: 回车 换行 ...
随机推荐
- 【转】android cts failed items
原文网址:http://blog.csdn.net/linsa0517/article/details/19031479 Fail的一些修改 1.直接设置问题 estUnknownSourcesO ...
- 数据结构之单链表,c#实现
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- SQL Server (MSSQLSERVER) 服务因 找不到指定的模块。 服务特定错误而停止。
新装了sql server 2008,发现sqlserver 服务没法起来.查看系统日志是7024如下: 事件类型: 错误 事件来源: Service Control Manager 事件种类: 无 ...
- safari浏览器cookie问题
这个题目可能有点大了,这里主要讨论一种解决safari浏览器阻止第三方cookie问题. 场景 公司存在多个域名(a.com,b.com,co.com)这些域名应该统一 ...
- Static用法
一.Static全局变量和全局变量的区别 1)全局变量(外部变量)的说明之前再冠以static 就构成了静态的全局变量.全局变量本身就是静态存储方式, 静态全局变量当然也是静态存储方式. 这两者在存储 ...
- [TI DLP Buglist]data type error in illum_EnableIllumination function
I am debuging my code today, I find when my code is running, it's stop at illum_EnableIllumination() ...
- Linux 块设备驱动 (二)
linux下Ramdisk驱动 1 什么是Ramdisk Ramdisk是一种模拟磁盘,其数据实际上是存储在RAM中,它使用一部分内存空间来模拟出一个磁盘设备,并以块设备的方式来组织和访问这片内存.对 ...
- ListView之SimpleAdapter
SimpleAdapter是安卓内置的适配器,本文展示的是listview的子项为{图片,文件}组合 如下图所示: 具体代码: SimpleAdapter_test.java /* ListView ...
- Unity 读取CSV与Excel
前几天看到我们在游戏中需要动态加载某些角色的游戏策划值,关于这个问题怎么解决呢?其实办法很多种,归根到底,就是数据的读取.我们可以想到的存储数据的载体有很多.例如:txt,xml,csv,excel. ...
- java获取文件大小
1.使用File的length()方法获取.这个方法获取的字节数,由于返回的是Long类型所以能返回的最大值是Long.MAX_VALUE File file = new File( "D: ...