Trouble installing opencv 4.0.0 under linux
Hi, As far as I understand it, to install opencv 4.0.0 on a mint 18 linux, i need to build it from sources. So I tried (and failed).
The Website (https://docs.opencv.org/4.0.0/d7/d9f/...) informs:
cd ~/<my_working_directory>
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
cd ~/opencv
mkdir build
cd build
so far nothing exciting. Next:
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
which yields:
CMake Error at CMakeLists.txt:11 (message):
FATAL: In-source builds are not allowed.
You should create a separate directory for build files.
-- Configuring incomplete, errors occurred!
I tried to add -DCMAKE_SOURCE_DIR and/or -DMAKE_BINARY_DIR but more or less in vain.
Can someone help me?
Regards
Leo
did you really cd into your build folder ? shouldn't it be:
mkdir build && cd build
?yes, you're right. Sorry the forum is ignoring single line feeds, so i had to make double line feeds (which looks kind of strange). Yes i did cd into the right dir (otherwise it would complain about missing CMakeLists.txt.
you can also mark your code and press ctrl-k to format it properly
thanks, this is much more readable.
otherwise it would complain about missing CMakeLists.txt
it doesn't if there is~/<my_working_directory>/CMakeLists.txt
file.dkurt, you're right. On the other hand, it would have to be not just any CMakeLists.txt, but one which starts (
up to line 11
)just like the one for opencv. But I have no experience using cmake, maybe this is standard for all of these files.Maybe you have some unusual characters in
~/<my_working_directory>
? I.e. whitespaces, non English characters,opencv
oropencv2
folders names (there were some issue about it https://github.com/opencv/opencv/issu... Try to clean up build foldercd build && rm -rf *
and check that there is no extra files in source tree generated by cmake:cd /path/to/opencv && git status
.Well, there were no unusual characters, but it was on an encrypted fs (/media/veracrypt2/opencv). When I did the same on /home/etc... everything worked fine. Never would have guessed that, i thought there were good chances of wasting my time, when i did it on my home dir.
Thank you dkurt :)