启动C++程序时出现问题
Trouble starting C++ Program
我有一个C++-Makefile项目,我构建并链接了它,一切都很顺利。
-- Configuring done
-- Generating done
-- Build files have been written to: /folder/build/
首先,我使用bash用cmake配置项目,然后我在eclipse中将该项目加载为"现有的makefileproject"并构建它。构建也很顺利,但在尝试运行该程序时,我得到了一个错误:
Error starting process.
Exec_tty error:Cannot run program "/folder/build/programname": Unknown reason
Exec_tty error:Cannot run program "/folder/build/programname": Unknown reason
Exec_tty error:Cannot run program "/folder/build/programname": Unknown reason
我也试着从bash运行该项目,但最终得到的错误消息是:
If 'programname' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf programname
我使用ls -l programname
来获取有关该文件的信息。
-rw-r--r-- 1 username users 6411620 Apr 27 13:54 programname
当我尝试用改变读写方式时
chmod 777 programname
什么也没发生,程序名信息保持不变。
我的项目建设出了什么问题?
以下是一些尝试:
- 尝试一个简单的程序(例如helloworld)来确保您的环境设置正确。如果你做helloworld,一定要放一个
sleep(5);
语句或类似的东西,这样它就会在屏幕上停留足够长的时间来观看它 - 尝试在Eclipse中构建程序,并让它为您生成make文件
- 请确保您的权限设置正确(这是您使用chmod时所做的),但请执行其他ls-l操作以确保您对权限的更改有效。我建议
chmod 760 programname
更加符合安全策略 - 要在Linux中运行程序,可以cd到包含该程序的目录,然后键入
./programname
希望其中一个对你有用!
相关文章:
- 警告处理为错误这里有什么问题
- 最小硬币更换问题(自上而下方法)
- 为"adjacent"变量赋值时出现问题
- 我的神经网络不起作用 [XOR 问题]
- 在Ubuntu 16.04上安装Cilk时出现问题
- C++我的数学有什么问题,为什么我的代码不能正确循环
- 编译包含字符串的代码时遇到问题
- Project Euler问题4的错误解决方案
- 问题:什么是QAbstractItemView::NoEditTriggers的反面
- 在编译C++代码(具有dlib和opencv)到WASM时面临问题
- 在进程中对同一管道进行读取和写入时C++管道出现问题
- 静态数据成员的问题-修复链接错误会导致编译器错误
- C++ 雷神库 - 使用资源加载器类时出现问题(不命名类型)
- 一个关于在C++中重载布尔运算符的问题
- 首要问题的答案让值班员搞错了
- setlocale的C++土耳其字符串问题
- 如何重构类层次结构以避免菱形问题
- 基于boost的程序的静态链接——zlib问题
- C++格式化输出问题
- 使用mongocxx驱动程序时包含头文件问题