Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does C++ have a package manager like npm, pip, gem, etc? [closed]

Tags:

c++

Just wondering the best way to install cpp packages. My background is in JS/Ruby/etc, so it seems so weird there's no cpm or the like. What am I missing? I assume it's not this simple...

For an example, I can't even run a .cpp file with #include <iostream> as I get fatal error: 'iostream' file not found

Edit for clarity: iostream was a bad example, my system config was wonked back when I wrote this. Replace it in your imagination with a non-standard library.

like image 781
elzi Avatar asked Jan 09 '15 18:01

elzi


People also ask

Why does C++ not have a package manager?

Perhaps because C++ is less homogenous. Apple provides more standard stuff to build packages on top off. In C++ one can hardly agree on what string class to use. I would just like to point out that the package managers from other languages are not perfect.

Does C++ have package management?

vcpkg is a free C/C++ package manager for acquiring and managing libraries. Choose from over 1500 open source libraries to download and build in a single step or add your own private libraries to simplify your build process. Maintained by the Microsoft C++ team and open source contributors.

Does C++ have pip?

No, the C++ language specification does not require packages nor package managers. There is no concept of packages in the C++ specification. The concept of packaging is usually left to the compiler or IDE. I just started developing in C and have the same background as you have.

What Linux distro uses pip?

Linux distributions like Ubuntu, Debian, Mint, Kalie, RHEL, CentOS etc. can use the pip tool in order to manage Python packages.


2 Answers

There seem to be a few though I've never used them.

dds https://github.com/vector-of-bool/dds

cpm http://www.cpm.rocks/

conan https://conan.io/

pacm http://sourcey.com/pacm/

spack https://spack.io

buckaroo http://buckaroo.pm

hunter https://github.com/ruslo/hunter

vcpkg https://github.com/Microsoft/vcpkg

like image 154
user3071643 Avatar answered Sep 21 '22 12:09

user3071643


Conan is the clear winner today based on its 36+ GitHub contributors and the fact I found their Getting Started documentation to be easy enough to get working. It's MIT licensed too.

Conan's documentation even compares it to biicode which I was surprised wasn't mentioned in other answers, but biicode seems to be abandoned much like cpm.

pacm has some activity but is LGPL which may be an issue for some projects.

This builds on user3071643's answer, thanks!

like image 35
pzrq Avatar answered Sep 25 '22 12:09

pzrq