I notice that yesterdaya new version of OpenCV was released, v2.3.
I can't install this version in my Mac using cmake and the basic instructions to compilate the sourcecode for Linux & Unix.
I obtained this error message when I execute the make instruction:
/Users/jorgevegasanchez/Downloads/OpenCV-2.3.0/modules/highgui/src/cap.cpp: In function ‘CvCapture* cvCreateCameraCapture(int)’:
/Users/jorgevegasanchez/Downloads/OpenCV-2.3.0/modules/highgui/src/cap.cpp:130: error: ‘CV_CAP_OPENNI’ was not declared in this scope
/Users/jorgevegasanchez/Downloads/OpenCV-2.3.0/modules/highgui/src/cap.cpp:131: error: ‘CV_CAP_ANDROID’ was not declared in this scope
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2
There is no problem when installing OpenCV 2.2 using cmake. I think there is an error or a mistake with OSX version of OpenCV 2.3 version.Or I made something wrong ???
Thanks in advance.
You likely have a previous version of opencv2 installed already. Check /opt/local/include and /opt/local/lib. If this is the case, these locations likely take precedence on you system PATH when you try to compile opencv2.3 resulting in the above errors. Either remove the old opencv version or temporarily move that relate to opencv2 from the above mentioned folders while you compile the new version.
I'm not sure your build won't have any more errors, but a quick hack is to protect those constants on a #ifdef block.
Go to those lines where the error occurs and notice that those 2 constants are used to initialize an int array named domains. You can change it's definition to:
int domains[] =
{
#ifdef HAVE_VIDEOINPUT
CV_CAP_DSHOW,
#endif
CV_CAP_IEEE1394, // identical to CV_CAP_DC1394
CV_CAP_STEREO,
CV_CAP_PVAPI,
CV_CAP_VFW, // identical to CV_CAP_V4L
CV_CAP_MIL,
CV_CAP_QT,
CV_CAP_UNICAP,
#ifdef HAVE_OPENNI
CV_CAP_OPENNI,
#endif
#ifdef HAVE_ANDROID_NATIVE_CAMERA
CV_CAP_ANDROID,
#endif
-1
};
This will fix those specific errors, and hopefully you won't have others.
EDIT:
I just downloaded OpenCV 2.3 and compiled it using the standard procedure and everything went fine. No errors!
tar -xjvf OpenCV-2.3.0.tar.bz2
cd OpenCV-2.3.0
mkdir build
cd build/
cmake ../
make
sudo make install
You likely have a previous version of opencv2 installed already. Check
/opt/local/include and /opt/local/lib. If this is the case, these
locations likely take precedence on you system PATH when you try to
compile opencv2.3 resulting in the above errors. Either remove the old
opencv version or temporarily move that relate to opencv2 from the
above mentioned folders while you compile the new version.
Thanks. It works fine now with mine with OpenCV 2.3.1 under Mac 10.6.8
Update cmake:
sudo port install cmake
Related
I'm trying to build ORB_SLAM2 on macOS 11.4 with clang 12 and OpenCV4 and have run into this error:
make[2]: *** No rule to make target `/usr/lib/libz.dylib', needed by `../lib/libORB_SLAM2.dylib'. Stop.
This file does not exist on my Mac and I cannot add this symlink due to macOS's SIP. The correct path should be /usr/local/opt/zlib/lib/libz.dylib
How can I fix this /usr/lib/libz.dylib reference?
Here is my branch with my macOS build changes.
I've tried to fix the problem by:
Inspecting each of the project's direct dependencies with otool -L and rebuilt from source where necessary (such as OpenCV) to make sure /usr/lib/libz.dylib is not referenced (fix suggested here)
Using CMake's FindZLIB.cmake module in the ORB_SLAM2 CMakeLists.txt to ensure the correct ZLIB is found
Below is the output showing ZLIB is found but still no luck:
-- Found ZLIB: /usr/local/opt/zlib/lib/libz.dylib (found version "1.2.11")
Solved: I checked the CMakeFiles/Makefile.cmake and it showed me that the Pangolin library I was using was actually one from another project of mine. Building Pangolin in this project solved the issue.
I am trying to compile gdb 9.2 in Ubuntu 18.04, The following errors are printed.
make[2]: Entering directory '/home/ata/gdb-9.2/build/gdb'
CXX ada-exp.o
ada-exp.y: In function ‘int ada_parse(parser_state*)’:
ada-exp.y:736:15: error: ‘yyin’ was not declared in this scope
ada-exp.y:736:15: note: suggested alternative: ‘yylen’
ada-exp.y:736:3: error: ‘lexer_init’ was not declared in this scope
ada-exp.y:736:3: note: suggested alternative: ‘pex_init’
In file included from ada-exp.y:56:0:
gdb 10.1 compiled successfully before this.
I searched online but could not come up with a reason or solution.
What might be the issue ?
Edit1: I have gcc version 7.5.0
I also faced this issue and this is how I fixed it:
ada-exp.y includes file ada-lex.c which contains the definition for function lexer_init.
But if you don't have flex installed initially, then it may generate an empty ada-lex.c (from ada-lex.l). And even if you do make clean, it will not clean the generated ada-lex.c, i.e., it will remain empty upon next compile command as well.
So to fix this error, you can delete all such intermediate .c files (in your case, building with fresh .tar.gz) and do the make again.
Pantheios INSTALL.TXT says:
Open a command shell in the appropriate directory that matches your compiler: ...
My compiler is Clang:
> gcc --version
Apple LLVM version 5.1 (clang-503.0.40) ...
Target: x86_64-apple-darwin13.3.0
Which of the compiler settings files in Pantheios 1.0.1-beta214 is the most appropriate?
You can use homebrew to install an older version of gcc (e.g., gcc-4.2) and use the matching Pantheios makefile, like this:
brew install gcc42
make CC=gcc-4.2
However, as far as I have been able to tell, Pantheios is not going to be buildable on a recently-updated system. For example, as of today, building on OSX looks like this:
04:29:23 ~/src/pantheios-1.0.1-beta214/build/gcc42.unix$ make CC=gcc-4.2
Ensuring all STLSoft C source files are in UNIX format
sed: RE error: illegal byte sequence
make: *** [/Users/username/src/stlsoft-1.9.118/include/stlsoft/internal/dos2unix.has.been.performed] Error 1
I have also tried building on Windows as recently as 6 months ago and lost a good bit of time on it before giving up.
The library hasn't been updated in a very long time and the author has very little online activity since then. I call that "abandoned software". Building will very likely require a non-trivial amount of work on your part. I'd highly recommend severing the dependency on STLSoft if you do because it also appears to be abandoned.
I'm working in OSX and I'm attempting to run a make file and when I try I get the following:
ld: library not found for -lgsl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [harm] Error 1
Earlier I found out the I needed to get the gsl library and I used mac ports and typed:
sudo port install gsl
into my command line window and it seemed to isntall okay. Is the missing lgsl not configured correctly or does it not come with gsl? I tried googling lgsl but didn't get much. I've only been at programming a few days and I don't know if I was supposed to set a path, or even really how to do that.
Thanks for any help you guys could offer.
I just wanted to say that I had the exact problem on OSX. Rather than setting an environment variable, I used an additional compiler flag -L/opt/local/lib, which then lets one use -lgsl. I reference this answer.
I got the same issue and here is how I fixed it:
export LIBRARY_PATH=/usr/local/Cellar/gsl/1.16/lib/
I had previously installed gsl using:
brew install gsl
You need to add the path for where the macports installed the gsl library to your LD_LIBRARY_PATH environment variable (or most likely into the build script environment). I believe macports stores things in /opt/local/lib
I'm trying to compile pulseaudio on Mac OS X, however by default I get lots of errors about not finding standard files like inttypes.h, errno.h or stdio.h. Putting -isystem/usr/include in CPPFLAGS fixes those errors, but then later on I get fatal error: 'CoreServices/CoreServices.h' file not found.
I've tried also adding -framework CoreServices and/or
-I/System/Library/Frameworks/CoreServices.framework/Headers but neither work.
What's the proper way of making the compiler find it?
I think I'm using clang, gcc produces even more errors.
You are on the right track, those are the framework and include flags but if you use the correct configuration options you will find even the system includes are picked up properly.
The Makefiles will attempt to set the framework appropriately based on the --with-mac-sysroot and --with-mac-version-min attributes.
Example configuration option to specify the SDK location:
--with-mac-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/
--with-mac-version-min=10.7
If you are building on Mountain lion (10.8) you still need to use the 10.7 minimum compatibility as there are headers missing in the 10.8 SDK which PulseAudio makes reference to.
You can pass the configure options to the autogen.sh which will run configure once autoconf has completed. You can try the following command which has been tested on the master branch:
./autogen.sh --prefix=/usr/local --disable-jack --disable-hal --disable-bluez --disable-avahi --with-mac-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/ --with-mac-version-min=10.7 --disable-dbus
If you get m4 macro errors copy the m4 macros from aclocal into the m4 sub-directory and try again.
There are a few other problems but these are bound to be cleared up may date quickly. Adding it here as it may help someone trying to get this built.
error: Multiprocessing.h cannot be found:
This has been deprecated in 10.7 but the headers are still included it CoreServices and will build just change the include instruction in the file src/pulsecore/semaphore-osx.c.
-#include <Multiprocessing.h>
+#include <CoreServices/CoreServices.h>
error: ‘lt_PROGRAM_LTX_preloaded_symbols’ undeclared.
This may be a problem compiling src/daemon/dumpmodules.c and can be fixed by declaring the external macro.
extern const lt_dlsymlist lt_preloaded_symbols[];
error: gdbm.h: No such file or directory
For some reason the default include dir is not considered by the compiler and you can add the path to the src/Makefile look for and set the variable GDBM_CFLAGS.
GDBM_CFLAGS=-I/usr/local/include
nJoy!