I am developing command line interface executables for both osx and linux using c/c++. The project will link against opencv. Should I use libc++ or libstdc++?
I would use the native library for each OS i.e. libstdc++ on GNU/Linux and libc++ on Mac OS X.
libc++ is not 100% complete on GNU/Linux, and there's no real advantage to using it when libstdc++ is more complete. Also, if you want to link to any other libraries written in C++ they will almost certainly have been built with libstdc++ so you'll need to link with that too to use them.
More info here about the completeness of libc++ on various platforms.
Major Linux distributions do not provide LLVM libc++, because:
If eventually libc++ became part of distributions, it will be as an optional component. linking against it will probably require extra options.
Like Jonathan said, you should use whatever tool is included by default. Clang is safe in Linux to use since is configured as a GCC replacement, so in that aspect you don't have to worry about 2 compilers. Also since you are targeting two platforms, you should take a look to cmake.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With