2

I googled this a lot and I found very poor solutions on how packages are managed in C++.

Let's suppose that I am working on a project called Project C which is dependent on C++ project Project B, and Project B is dependent on another C++ project Project A.

Currently, we use Visual Studio to develop our projects. When Project A changes, every single developer pulls the changes and recompiles the project locally. Every single developer has a lib folder with all of these dependencies that contains the DLLs and header files that we copy for each project manually.
Then since we know the dependencies, we then go to every project that is dependent on Project A, copy the dlls of Project A from lib folder and recompile those as well until we get what we want.

I know however, that C# has nuget and one can manage external dependencies and Java has maven where one can do the same.

What we currently do is a manual, error prone and extremely time consuming process. Is there a way to handle dependencies for C++? We should be able to build with the debug ddls of the dependencies when compiling as debug and the release dlls when compiling as release. For now we just need to have the latest dlls.

We have jenkins installed and if we could use that to help us that would be perfect. For java projects our java engineers compile the project and maven packages are pushed into a maven repository from where everybody else is just pooling. As simple as that. But how we can achieve similar functionality in C++?

zerocukor287
  • 555
  • 2
  • 8
  • 23
andreas
  • 157
  • 13
  • 1
    No, C++ developers are doomed to perform that manual, error prone and extremely time consuming process over and over again. Maybe a situation will change once we get "modules", however I doubt it. If someone tells you that he has got a build system for C++ with proper dependency management that would be suitable for any project you can punch him in the face. – user7860670 Jul 26 '18 at 09:26
  • Portable C++ has no packages, projects nor solutions. It only knows about header and source files. That being said there are build systems for the task. – Ron Jul 26 '18 at 09:26
  • You can use maven for C++, use the nar plugin. – john Jul 26 '18 at 09:30
  • 1
    I would suggest that you look up custom build steps. – UKMonkey Jul 26 '18 at 09:30
  • 2
    There are package managers for C++ too, like [conan.io](https://conan.io/), [hunter](https://github.com/ruslo/hunter) or [vcpkg](https://github.com/Microsoft/vcpkg). Though maven is also a build tool, those 3 can integrate with `cmake`. – Jorn Vernee Jul 26 '18 at 09:41
  • @VTT • C++20 will, hopefully, have Gabriel's modules. That'll be a game changer. But it will take a very long time to transition from the current situation to a module-savvy code base. During the transition time, we'll have a foot in the old and a foot in the new, which will be even more unpleasant than just doing it the current way. – Eljay Jul 26 '18 at 14:24
  • Does this answer your question? [Does C++ have a package manager like npm, pip, gem, etc?](https://stackoverflow.com/questions/27866965/does-c-have-a-package-manager-like-npm-pip-gem-etc) – zerocukor287 Apr 12 '22 at 12:10

0 Answers0