8 ms·
> So sockets, file system calls, event loops, file configuration & default folders... It's never THAT different but different enough that just compiling your co
by jcelerier 8y ago
> So sockets, file system calls, event loops, file configuration & default folders... It's never THAT different but different enough that just compiling your code won't work.
But if you use something like Qt you've got all of this cross-platform out of the box - I have a multiple hundred lines of code C++ software which does all this and much more ; it has almost zero platform-specific stuff except one function at some point to set real-time priorty to threads.
- burntsushi 8y agoSo you think it's appropriate for tools like ripgrep and xsv to bundle a gui toolkit to do its job? I feel like this whole line of argument is disingenuous. In Rust, you don't need to bundle a GUI toolkit to get cross platform stuff that works. The standard library was built with Windows in mind, and it shows. You don't need any additional POSIX layer. You just use the standard library. If you go and look at competitors to things like xsv and ripgrep that are written in C or C++, they either require some kind of POSIX thing on Windows to run correctly (like cygwin), or they jump through lots of hoops to behave as a native Windows application. It really should not be a controversial statement to say that Rust has a better cross platform story (Windows/mac/Linux). It was a design goal.
- jcelerier 8y ago> So you think it's appropriate for tools like ripgrep and xsv to bundle a gui toolkit to do its job? Qt is not a GUI toolkit, it's a general framework. If you only link to -lQtCore you won't have anything remotely related to GUI in your binary. For instance doxygen is built like this.
- burntsushi 8y agoWhy isn't this more common then? I've literally never seen this done in any of the C++ command line tools I've looked at.
- jcelerier 8y agohttps://github.com/search?l=QMake&q=%22CONFIG+%2B%3D+console%22&type=Code https://github.com/search?l=QMake&q=%22CONFIG+%2B%3D+console... common enough for me
- dj43nq 8y agoDon’t you end up with licensing fees if you use QT in a commercial product? Seems like a downside to me.
- detaro 8y agoLGPL isn't that hard to comply with for a desktop application, so no.
- littlestymaar 8y agoWith LGPL, you can't statically link the library though. Which requires your user to install it manualy, unless you package your software with some kind of installer (which is not so common on windows for cli executables).
- jcelerier 8y ago> With LGPL, you can't statically link the library though. no, that's tiresomely false. You can link proprietary code statically with LGPL code. LGPL does not give a shit about static or dynamic libraries because LGPL is not a language-specific license. Right from the source: https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynami...
- littlestymaar 8y agoThanks for the link. The nuance I was missing is that you can distribute statically-linked LGPL library as long as you provide a way for your user to override the chosen library with his own version of the library.
- detaro 8y agoIt's very common to ship windows CLI tools as a .zip file with an exe and a bunch of .dlls, that's not exactly burdensome to install compared to only an executable.
- jcelerier 8y ago