(菜鸟贴)gcc编译c++出错提示

在尝试使用GCC编译包含C++类的源文件时,遇到了'cc1plus'未找到的错误以及多个语法错误。错误提示表明GCC不支持C++的特性。问题可能在于GCC配置或版本不支持C++,需要确保安装了正确的G++编译器来处理C++代码。
摘要由CSDN通过智能技术生成

jonny@jonny-GF7050-M2:/media/Data/college/大二(下)/操作系统/课件/第十周课件$ gcc -linclude main.cpp Memory.h Page.h PageControl.h
gcc: error trying to exec 'cc1plus': execvp: 没有那个文件或目录
Memory.h:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘CMemory’
Memory.h:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
Memory.h:47: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
Memory.h:65: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
Page.h:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cpage’
PageControl.h:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘CpageControl’
jonny@jonny-GF7050-M2:/media/Data/college/大二(下)/操作系统/课件/第十周课件$

 

由于gcc不支持c++的类调用,也不支持c++的部分命名方式。因此会出现上述问题~

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值