3 ms·
I see you have never worked on a C/C++ project.
by jupp0r 6y ago
I see you have never worked on a C/C++ project.
- uhhhhhhhhhhhhhh 6y agoYeah this appears to be more or less the essential complexity of build+link
- mssundaram 6y agoLooks like you may be shadow banned - I vouched for this comment and see all your recent previous comments are dead
- Shorel 6y agoI have done both. C++ is miles better in comparison.
- jupp0r 6y agoMaybe you can enlighten me how to easily add a dependency (the equivalent of "yarn add lodash") in a platform-independent way.
- Shorel 6y agoI have used CMake. I added the dependency by writing about three CMake lines. And after that, it just works, for years. I may have to add from 2, to 5 dependencies for a project, instead of the myriad of dependencies in JS. And they don't become obsolete and need an update each week. It's a difference of some orders of magnitude, both in number and in upgrade frequency. This is a huge part of dependency management for me. And there are C++ package managers like Conan, which solve your requirement of adding a dependency by just using the command line. I will probably use Conan if I have to write C++ again.
- jupp0r 6y agoCMake only finds the dependencies, how do they get to your computer? Do you link statically or dynamically? What compiler toolchains are these libraries built with, do they use the same standard library as your code or different ones? When you want to cross compile, how do you find libraries for your target architecture? Conan makes much of this easier, but is not really suited for large software projects with the problems mentioned above - in my experience.
- Shorel 6y agoWell, I don't cross compile. If I need to test a new OS, then I get the VM and compile it there. About dependencies, if they can be found in the package manager then it goes that way. Else, they are a git submodule. The most problematic has indeed been the C++ MySQL connector, because it has changed a bit over the last five years, so I had to edit the #include lines in the source code files.
- jupp0r 6y agoChrome for example does not currently compile on darwin-arm64, cross compiling from darwin-x64 is the only way to build that target. When you are using git submodules as package manager, what do you do if the dependency doesn’t come with CMake files, but with autotools for example? I think bazel is becoming a great solution for these problems if you align with their philosophy.