码迷,mamicode.com
首页 > 其他好文 > 详细

g++ error: expected nested-name-specifier before 'XXX'

时间:2014-10-21 11:45:30      阅读:665      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   color   io   ar   for   sp   

 1 template <typename addrT=int,typename valuT=int,typename stream_addrT=bm_addr,typename stream_sizeT=int64> 
 2 class  stream_chip : public chip<addrT,valuT>{ 
 3 public: 
 4     typedef  typename stream_addrT stream_addr_type; 
 5     typedef  typename stream_sizeT stream_size_type; 
 6  
 7     stream_chip (bus_type * const owner, addr_type addr):chip<addrT,valuT>(owner,addr) 
 8     {} 
 9 public: 
10     virtual stream_size_type write_mem(stream_addr_type dest_addr, void* pValue ,stream_size_type size)=0;  //write board memory 
11     virtual stream_size_type read_mem(void* pValue,stream_size_type size ,stream_addr_type src_addr)=0;        //read bpard memory     
12  
13 };

 


明明全部代码都在VS编译下好好的

把以上public的typename删除就行了。错误就不报了。唉,移植就是ISO标准问题多。各平台的扩展实现也乱七八糟。

references:
http://bbs.csdn.net/topics/370075224
http://stackoverflow.com/questions/5249835/expected-nested-name-specifier-before-const-error-with-typename-const-in-g



g++ error: expected nested-name-specifier before 'XXX'

标签:des   style   blog   http   color   io   ar   for   sp   

原文地址:http://www.cnblogs.com/foohack/p/4039635.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!