7
AlgoRythm
163d

Something they don't tell you about c++ development until it's too late: cross-compiler compatibility is an enormous monster.

When I worked with C# creating a DLL and distributing it to others is a completely transparent process, there's no special considerations required at all.

In c++ you basically aren't allowed to use the standard library in many cases. You can't just export a class with a standard string as a member because when another person goes to use your DLL, the string might have a different implementation.

Comments
  • 1
    Only an issue if you distribute binaries, and even then you can probably just use C bindings IIRC.
  • 0
    @Fast-Nop yeah, I'm coming to learn why things like libcurl and boost don't have binaries available. I started my visual studio project off like I do with C# and added the app logic to one project and the unrelated (& potentially reusable) logic to other projects, such as state machine and HTTP client. But come to find out that DLLs don't play nicely in c++ land, I just went the easier route and put everything in back in one project.
  • 0
    @AlgoRythm libcurl is obviously a c library, but the point still stands that unless you use a package manager you do indeed download a bundle of source code.
  • 1
    C# compiles differently. That's the big kicker.
  • 1
    @iSwimInTheC C# actually compiles at runtime. To machine code, at least; and only on the first run.
  • 2
    Binary compatibility isn't guaranteed because forcing something like this on distributions is silly, but GCC makes a point of ensuring binary compat between minor version updates of the compiler.
  • 1
    There are also 3rd party standard library implementations that improve compat by ensuring that eg. everything that uses them explicitly shares an allocator.
  • 0
    C++ is something I don't wanna touch at all. I just know it is not my cup of tea.
Add Comment