在没有root权限的linux上安装gcc [英] Install gcc on linux with no root privilege

查看:1141
本文介绍了在没有root权限的linux上安装gcc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在公共库中访问计算机,我想尝试一些C ++和其他代码。问题是没有安装g ++,我无法使用软件包安装它,因为我没有根访问。是否有一种聪明的方式来创建一个完整的环境在家庭文件夹中编程?

I have access to computer in a public library and I want to try out some C++ and maybe other code. Problem is that there is no g++ installed and I can't install it using packages because I have no root access. Is there a "smart" way to make a full environment for programming in a home folder?

我有gcc安装(我可以编译C代码)。此外,我有一个家庭文件夹是一致的。我不知道在哪里找到预编译的g ++,我发现只有源,但我不知道该怎么办。我试图要求他们安装这个但它没有工作:)

I have gcc installed (I can compile C code). Also, I have a home folder that is consistent. I don't know where to find precompiled g++, I found only source but I don't know what to do with it. I tried to ask them to install this but it didn't work :)

推荐答案

您可以运行configure脚本 - -prefix参数: ../ gcc-4.5.0 / configure --prefix = / home / foo / bar 。由于c ++标准库很可能不同于您系统上的库,因此您必须先设置 export LD_LIBRARY_PATH = / home / foo / bar / lib 启动由此编译器编译的程序。

You can run the configure script with the --prefix parameter: ../gcc-4.5.0/configure --prefix=/home/foo/bar. Since it is very likely that the c++ standard library is different then the one on your system, you have to set export LD_LIBRARY_PATH=/home/foo/bar/lib before you can start a program compiled by this compiler.

这篇关于在没有root权限的linux上安装gcc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆