Is there a python virtualenv equivalent for C / C ++ programs?

I need to develop C ++ programs that should run on Scientific Linux 5 or 6. I would like to develop with QtCreator on Ubuntu, which has much more recent libraries than the one found on SCL6.

Is there a python virtualenv equivalent for C / C ++ programs?

Using chroot with all the necessary libraries and dependencies can do the job. Does it exist? See http://rcrowley.org/articles/dependencies.html about using chroot.

+11
c ++ c virtualenv
source share
4 answers

Use debootstrap to create a chroot environment (or even install ubuntu on a separate partition). Install your home directory with mount -o bind. Use the convenient chroot setting for schroot.

http://manpages.ubuntu.com/manpages/precise/en/man8/debootstrap.8.html

http://manpages.ubuntu.com/manpages/precise/en/man8/mount.8.html

http://manpages.ubuntu.com/manpages/precise/en/man1/schroot.1.html

+1
source share

Not sure if it is light enough for what you need (I am not very familiar with virtualenv), but you can try CDE Project , which is a very good way to create a virtual sandbox with all kinds of dependencies.

+1
source share

You can install the dependencies and the compiler for a given project using a build system such as bazel ( https://bazel.build/ ) or please ( https://please.build/ ).

It will never be as accurate as virtualenv, due to the different nature of the language, and since it will still use the system compiler. If you want to completely isolate your project, you can send it to the docker container.

0
source share

I agree with SeF using dependencies. For me, the IDE helped establish a different development environment.

Regarding IDE for different OS:

0
source share

All Articles