开发者

compiling OpenCV on Mac OS X Snow Leopard gets error: ‘Movie’ does not name a type

开发者 https://www.devze.com 2022-12-23 05:55 出处:网络
When I\'m trying to compile OpenCV on Mac OS X Snow Leopard I receive the following error: highgui/cvcap_qt.cpp:76: error: ‘Movie’ does not name a type

When I'm trying to compile OpenCV on Mac OS X Snow Leopard I receive the following error:

highgui/cvcap_qt.cpp:76: error: ‘Movie’ does not name a type

There's a structure like this:

/// Movie state structure for QuickTime movies                                                                  
typedef struct CvCapture_QT_Movie                                                                               
{                                                                                                               
  Movie      myMovie;   // movie handle                                                          
  GWorldPtr  myGWorld;  // we render into an offscreen GWorld       
  ...
}  

But I don't know w开发者_如何学运维here this type is defined. The QuickTime header is included:

// Mac OS includes                                                                                              
#include <Carbon/Carbon.h>                                                                                      
#include <CoreFoundation/CoreFoundation.h>                                                                      
#include <QuickTime/QuickTime.h>

What do I need to do to build it?


As a quick workaround, you could grab a pre-built Universal Framework from version 1.2 here: http://www.ient.rwth-aachen.de/cms/software/opencv/


The legacy QuickTime framework did not make the transition to 64-bit, so you'll need to make sure you're compiling as 32-bit.


Hi I had the same problem exactly on snow leopard 10.6.2. So I built the library without enabling quicktime. There must be a work around to whatever you are doing without enabling quicktime right?

To build the library without using quicktime, follow section 2 (Building from source using the new CMake build system) exactly without enabling extra options in

http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port

Hope this helps.


I finally got to compiling OpenCV on MacOSX 10.6, and this may solve the issue...

First, from http://opencv.willowgarage.com/wiki/Mac_OS_X_OpenCV_Port , compile in i386 mode by issueing

svn co https://code.ros.org/svn/opencv/trunk/opencv
cd opencv # the directory containing INSTALL, CMakeLists.txt etc.
mkdir build
cd build
cmake -D CMAKE_OSX_ARCHITECTURES=i386 -D CMAKE_C/CXX_FLAGS=-m32 -D WITH_FFMPEG=OFF -D BUILD_EXAMPLES=ON -D BUILD_LATEX_DOCS=ON ..
make -j2
sudo make install

Eventually, I had to rebuild some ports:

sudo port install ilmbase +universal
port provides /opt/local/lib/libIlmImf.dylib
sudo port install openexr +universal

and recompile openCV

Then I could run python examples

cd ../samples/python/
python camera.py

and facedetect with no error (and webcam working).

0

精彩评论

暂无评论...
验证码 换一张
取 消