I'm trying to set up an automated build system for OpenCV 2.4.8 (downloaded from the OpenCV site) to link it into a parent project. I'm roughly following the instructions for building here: https://sites.google.com/site/yonasstephenfyp2013/updates/tutorialinstallingopencvonmacosxmountainlion
Macos Cl Link For Libc 1
Unfortunately my build machine is running MacOSX 10.8 and I am running 10.9 locally and it seems the default clang C++ library has changed between the two from libstdc++ (see here: http://stackoverflow.com/questions/19637164/c-linking-error-after-upgrading-to-mac-os-x-10-9-xcode-5-0-1)
- On Mac OS 10.7 (Lion) and later, the easiest way to get this library is to install Xcode 4.2 or later. However if you want to install tip-of-trunk from here (getting the bleeding edge), read on. The following instructions describe how to checkout, build, test and (optionally) install libc and libcabi.
- LLVM-GCC 3.4 Front End Binaries for MacOS X/PowerPC (6.3M) LLVM-GCC 3.4 Front End Source Code (28M) LLVM-GCC 4 Front End Binaries for MacOS X/x86 (36M) LLVM-GCC 4 Front End Binaries for MacOS X/PowerPC (42M) LLVM-GCC 4 Front End Binaries for Red Hat Enterprise Linux4/x86 (28.0M) LLVM-GCC 4 Front End Binaries for Fedora Core5/x86 (28.0M).
- I want to enable debug version of libc in macOS, so I define LIBCPPDEBUG=1 in cxxbuildflags Debug Version of libC, but unable to link debug function of libc. I guess there is only release.
Use IPv6 on Mac. IPv6 is a version of the Internet Protocol (IP) that provides more IP address space for internet users. The primary advantage of IPv6 is that it increases the address size from 32 bits (the IPv4 standard) to 128 bits.
My parent project is set to use libc++ (this is configured in XCode). Combined with the clang default of libc++ on 10.9 this works fine on my machine. BUT it's causing a bunch of linker errors on my build machine basically not finding the std library). I would therefore like to tell OpenCV to build with libc++. Is there any way of doing this with CMake options?? I have tried passing
DCMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY='libc++' -DCMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD='c++0x' -DCLANG_CXX_LIBRARY='libc++' -DCLANG_CXX_LANGUAGE_STANDARD='c++0x'
but CMake informs me these are ignored:Is there any other way I can fix this? Perhaps changing the CXX_COMPILER_FLAGS??
Macos Cl Link For Libc 9
I don't think switching the project to libstdc++ will work either - I don't think I'll be able to build it locally on my machine then.
editretagflag offensiveclosemergedelete
Macos Cl Link For Libc 4
Comments
Macos Cl Link For Libc 7
answer was the following flags to cmake
-DCMAKE_CXX_FLAGS='-std=c++11 -stdlib=libc++' -DCMAKE_EXE_LINKER_FLAGS='-std=c++11 -stdlib=libc++'