错误之二:程序清单3.6 morechar.cpp

书籍名称:C++ Primer Plus(中文第五版)

错误说明:char ch 应为 char c

Code:
  1. //morechar.cpp--the char type ande int type contrasted   
  2.   
  3. #include <iostream>   
  4. int main()   
  5. {   
  6.   using namespace std;   
  7.   char ch='M';      //assign ASCII   
  8.   int i=ch;              //store same code in an int   
  9.   cout<<"The ASCII code for "<<ch<<" is"<< i <<endl;   
  10.   
  11.   cout<<"Add one to the character code:"<<endl;   
  12.   ch=ch+1;         //change character code in c   
  13.   i=ch;                //save new character code in i   
  14.   cout<<"The ASCII code for "<<ch <<" is"<<i<<endl;   
  15.          //using the cout.put() member function to display a char   
  16.   cout<<"Displaying char ch using cout.put(ch):";   
  17.   cout.put(ch);   
  18.         //using cout.put() to display a char constant   
  19.   cout.put(ch);   
  20.         //using cout.put() to display a char constant   
  21.   cout.put('!');   
  22.   cout<<endl<<"Done"<<endl;   
  23.   return 0;     
  24.   
  25. }   

 

当出现"ImportError: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory"错误时,这通常是由于缺少Python的共享库文件导致的。共享库文件是一组用于在运行时共享的二进制文件,它们包含程序所需的代码和功能。 为了解决这个问题,你可以尝试以下几个步骤: 1. 检查Python版本:首先确保你正在使用正确的Python版本。错误中提到的缺失的共享库文件是libpython3.6m.so.1.0,意味着你的代码需要Python 3.6版本。确认你已经正确地安装了Python 3.6。 2. 确认共享库文件存在:使用ldd命令检查是否存在缺失的共享库文件。例如,使用以下命令检查libpython3.6m.so.1.0文件的位置:ldd /usr/local/bin/python3.6 这将列出与Python解释器相关的共享库文件及其路径。 3. 更新库路径:如果共享库文件确实存在于系统中,但是路径不正确,你可以通过更新LD_LIBRARY_PATH环境变量来解决问题。使用以下命令将正确的路径添加到LD_LIBRARY_PATH变量中:export LD_LIBRARY_PATH=/path/to/python/libraries:$LD_LIBRARY_PATH 其中 "/path/to/python/libraries" 是你Python共享库文件所在的路径。这样做将帮助系统找到正确的共享库文件。 4. 重新安装Python:如果上述步骤都没有解决问题,你可以尝试重新安装Python。确保使用正确的安装包或命令来安装Python,并按照安装说明进行操作。重新安装Python可能会修复缺失的共享库文件问题。 总结起来,当出现"ImportError: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory"错误时,你可以按照上述步骤检查你的Python版本,确认共享库文件的存在并更新库路径,最后可以考虑重新安装Python来解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [ImportError: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory](https://blog.csdn.net/qq_35462323/article/details/121301683)[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_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [编译安装error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object fi](https://blog.csdn.net/weixin_43270713/article/details/115893600)[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_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [浅析python 动态库m.so.1.0错误问题](https://download.csdn.net/download/weixin_38703123/13735266)[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_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值