c++ - 在 Eclipse CDT 中执行 sudo make install?

标签 c++ eclipse opencv makefile installation

我正在使用 Eclipse Neon 为 OpenCV 做贡献。

我在 Project->Proprieties->C/C++ Build->Build command 中编辑了 Build 命令为 sudo make -j8 install,所以当我构建项目时,Eclipse 会编译 OpenCV 然后安装它在我的系统中。

然而,这是返回的错误:

sudo make -j8 install all 
sudo: no tty present and no askpass program specified

我认为这是因为 sudo 询问密码而 Eclipse 无法提供。我怎样才能做到这一点?我在主题上找到了这个[问题][1],但我不理解给定的[答案][2]

最佳答案

不要使用 sudo,而是使用另一种方法,它使用 GUI,例如 Gnome/LXDE 上的 gksudo 或 KDE 上的 kdesudo

如果你想使用sudo,你必须把这行

john ALL = NOPASSWD: /usr/bin/make

进入文件 /etc/sudoers,其中 john 是您的用户名,/usr/bin/make 是到使 可执行。通过这一行,您可以使用 sudo 启动 make,但无需输入凭据。

但是不要将这一行直接输入到 /etc/sudoers,你最好调用 sudo visudo,它会在编辑器中打开 sudoers 文件,如果你关闭程序,它会检查您对文件所做的更改。

关于c++ - 在 Eclipse CDT 中执行 sudo make install?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41943219/

相关文章:

spring - 如何配置 Eclipse 以使用 `ehcache`

java - 查询 Eclipse 插件中的 jar 条目

android - UnsatisfiedLinkError : n_Mat while using opencv2. 4.3 与 android 4.0

opengl - 使用 opencv 确定外部相机到具有世界空间对象的 opengl

c++ - 为什么我们需要 std::promise 和 std::future?

c++ - QFont 到 qss 样式表

c++ - 如何显示像 theta 这样的数学符号

c++ - 为什么编译器不自动内联自由定义的函数?而是导致链接器错误

java - 使用 Git 和 Eclipse

opencv - 计算图像积分