cppTest-0:基本程序结构

/**cppTest-0:基本程序结构
 *
 * author 炜sama
 */
#include<iostream.h>
int main(){
    int x=0,y=0,sum=0;//声明三个整型变量,其中,sum初始化为0
	int $a=10;//教程都说这种方式命名不合法,但是经测试发现c++和Java这种命名都合法!!!
	cout<<"Enter 2 integers separated by space:";//可以这么理解 <<x:放出(输出)x
	cin>>x>>y;//可以这么理解 >>x:射入(输入)某些内容到x
	sum=x+y;
	cout<<"The sum is "<<sum<<endl;//<<endl:回车换行
	cout<<$a<<endl;
	cout<<sizeof(x)<<endl;
	return 0;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这个错误的原因是在运行"./Log4cppTest"时,系统无法找到共享库"liblog4cpp.so.5",导致无法打开共享对象文件。 解决这个问题的方法是确保"liblog4cpp.so.5"库文件存在于系统的共享库路径中,并且路径已正确配置。您可以通过以下步骤来解决这个问题: 1. 首先,确认您已经安装了"liblog4cpp.so.5"库文件。您可以在终端中使用以下命令来查找该文件: ``` $ find / -name liblog4cpp.so.5 ``` 如果该文件存在,则会返回文件的路径。如果不存在,您需要下载并安装该库文件。 2. 一旦确认库文件存在,您需要将其路径添加到系统的共享库路径中。可以通过以下命令将库文件路径添加到/etc/ld.so.conf文件中: ``` $ sudo echo "/path/to/liblog4cpp.so.5" >> /etc/ld.so.conf ``` 请将"/path/to/liblog4cpp.so.5"替换为实际的库文件路径。 3. 更新共享库缓存,使系统能够找到新添加的库文件路径: ``` $ sudo ldconfig ``` 现在,您应该可以成功运行"./Log4cppTest",而不再出现"error while loading shared libraries: liblog4cpp.so.5: cannot open shared object file: No such file or directory"的错误信息了。请按照上述步骤进行操作,确保路径和命令的准确性。<span class="em">1</span><span class="em">2</span> #### 引用[.reference_title] - *1* [VS code出现错误:g++.exe: error: Hello: No such file or directory g++.exe: error: Word.cpp: No such ...](https://blog.csdn.net/qq_45708377/article/details/112732294)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [cpptest:C++学习笔记 包括 侯捷讲解的系列CPP课程以及UNP、APUE等](https://download.csdn.net/download/weixin_42122306/19205361)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值