Ask Your Question

samduke474's profile - activity

2019-02-25 03:21:39 -0600 received badge  Popular Question (source)
2014-03-21 14:53:07 -0600 commented question Specify libc++ when compiling/linking OpenCV for MacOSX 10.8

answer was the following flags to cmake -DCMAKE_CXX_FLAGS="-std=c++11 -stdlib=libc++" -DCMAKE_EXE_LINKER_FLAGS="-std=c++11 -stdlib=libc++"

2014-03-21 10:14:03 -0600 asked a question Specify libc++ when compiling/linking OpenCV for MacOSX 10.8

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

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)

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:

CMake Warning:
[13:54:00][OpenCV-Mac-Static-Libs (BUILD)]   Manually-specified variables were not used by the project:
[13:54:00][OpenCV-Mac-Static-Libs (BUILD)]     CLANG_CXX_LANGUAGE_STANDARD
[13:54:00][OpenCV-Mac-Static-Libs (BUILD)]     CLANG_CXX_LIBRARY
[13:54:00][OpenCV-Mac-Static-Libs (BUILD)]     CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD
[13:54:00][OpenCV-Mac-Static-Libs (BUILD)]     CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY

Is there any other way I can fix this? Perhaps changing the CXX_COMPILER_FLAGS??

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.

2013-10-15 10:55:59 -0600 received badge  Editor (source)
2013-10-15 10:53:57 -0600 asked a question Build OpenCV for android NDK with relative paths

I followed the instructions from here for building for linux/mac.

The output directory contains OpenCV.mk, however this uses absolute filepaths - which won't be much use after I commit to git. I had a play around with cmake manually but I couldn't find any options to get these paths to be relative.

Then I found the unix-install directory with make files that seem to have relative paths. If I used the makefiles from there instead of the ones in the parent directory, my project failed to compile. My question is is there any way to get get this build to work with relative paths right out the box?

2013-10-15 10:00:44 -0600 commented answer Building OpenCv4Android: CMAKE_CXX_COMPILER_ENV_VAR not set

problem was that the opencv version i had checked out didnt support android ndk r9.

2013-10-15 04:42:47 -0600 commented answer Building OpenCv4Android: CMAKE_CXX_COMPILER_ENV_VAR not set

Hi, i still get errors about the android toolchain etc doing as you say (I've specified the android NDK location)

2013-10-11 10:12:36 -0600 received badge  Supporter (source)