Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I was installing OpenCV 2.4.7 on a raspberry pi recently and faced that problem on the make command. After a bit of research, I found this page. What solved the problem was increasing the memory by adding a 3GB swap (1GB wasn't enough) file using the following commands (idea taken from site linked above):

fallocate -l 3072m /var/spool/swap
mkswap /var/spool/swap
swapon /var/spool/swap

then running make.

Not sure how you can do that on Windows, but given my experience, it seems that available memory is the likely culprit in your case. Do you absolutely need to run virtualbox? I imagine that alone will consume a large chunk of available memory.

My recommendation (based on my experience) would be to start fresh by deleting all your opencv files except the compressed file it came in and decompress it again. Then go into the created dir and create a dir called 'build'. Try to free up available memory by not running any other programs. Here is how I got it to work after that:

Go into the 'build' dir and enter:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D  BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D BUILD_JPEG=ON ..

then

make -j 4
sudo make install
sudo ldconfig