My situation is very similar to what's discussed in this thread. The reason I want to do this is that I am using OpenCV with CUDA 6.0, but CUDA is currently linked against libstdc++. I followed the answer that suggested putting the flag -stdlib=libstdc++
as well as the other approach where we set CXX
and CXXFLAGS
but as it was being commented: Macports did not seem to acknowledge the flags and still built with libc++ instead of intended libstdc++.
I would like to comment on that thread to ask for a follow-up, but unfortunately I do not have enough reputation yet.
Does anyone know how to get Macports to install OpenCV with libstdc++?
Edited 1: I have not gone back to check whether or not one of the answers provided below works. Compiling OpenCV with libstdc++ will cause issues with a few other non-CUDA projects that use libc++ primarily, so it is unlikely I will try. I will, however, accept an answer if someone can try out an answer below and comment to me if it works.
Edited 2: This question no longer applies to my situation since CUDA 7.0 RC has libc++ support by default. I will still accept an answer per Edited 1.