Home Fatal Error while building cmake file
Reply: 0

Fatal Error while building cmake file

user5477
1#
user5477 Published in August 16, 2018, 6:14 am

Hello all i am trying to use python3.6 with opencv and i link themn using cmake in last step make command i encountered this error message My OS is MAC OS Sierra

[85%] Built target example_tutorial_pnp_detection
[85%] Built target example_tutorial_pnp_registration
/Users/mertalptasdelen/opencv/modules/python/src2/cv2.cpp:7:10: fatal error: 'Python.h' file not found
#include <Python.h>
     ^~~~~~~~~~
[ 85%] Built target example_cpp_watershed
[ 86%] Built target example_cpp_videocapture_basic

This error came up to me my Cmake conf. was

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D PYTHON3_LIBRARY=/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6.dylib \
-D PYTHON3_INCLUDE_DIR=/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/include/python3.6m \
-D PYTHON3_EXECUTABLE=/Users/mertalptasdelen/.virtualenvs/cv/bin/python \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D BUILD_opencv_python3=ON\
-D BUILD_EXAMPLES=ON ..

and the build procces fully result was

[ 85%] Built target example_tutorial_pnp_detection
[ 85%] Built target example_tutorial_pnp_registration
/Users/mertalptasdelen/opencv/modules/python/src2/cv2.cpp:7:10: fatal    error: 'Python.h' file not found
 #include <Python.h>
     ^~~~~~~~~~
 [ 85%] Built target example_cpp_watershed
 [ 86%] Built target example_cpp_videocapture_basic
 [ 86%] Built target example_cpp_videostab
 [ 86%] Built target example_tutorial_video-input-psnr-ssim
 [ 86%] Built target example_cpp_videowriter_basic
 [ 86%] Built target example_tutorial_bg_sub
 [ 86%] Built target example_tutorial_imgproc_HoughLinesPointSet
 [ 86%] Built target example_tutorial_imgcodecs_imwrite
 [ 86%] Built target example_tutorial_core_various
 [ 86%] Built target example_tutorial_cloning_demo
 [ 86%] Built target example_tutorial_npr_demo
 [ 86%] Built target example_tutorial_objectDetection
 [ 86%] Built target example_tutorial_hdr_imaging
 [ 86%] Built target example_tutorial_non_linear_svms
 [ 86%] Built target example_tutorial_introduction_windows_vs
 [ 86%] Built target example_tutorial_display_image
 [ 87%] Built target example_tutorial_pose_from_homography
 [ 87%] Built target example_tutorial_gdal-image.
 [ 87%] Built target example_tutorial_core_merge
 [ 87%] Built target example_tutorial_homography_from_camera_displacement
 [ 87%] Built target example_tutorial_mat_mask_operations
 [ 87%] Built target example_tutorial_perspective_correction
 [ 87%] Built target example_tutorial_how_to_scan_images
 [ 87%] Built target example_tutorial_core_split
 [ 87%] Built target example_tutorial_file_input_output
 [ 87%] Built target example_tutorial_decompose_homography
 [ 87%] Built target example_tutorial_core_mat_checkVector.
 [ 87%] Built target example_tutorial_Drawing_2
 [ 87%] Built target example_tutorial_AddingImages
 [ 87%] Built target example_tutorial_cornerDetector_Demo
 [ 87%] Built target example_tutorial_cornerSubPix_Demo
 Scanning dependencies of target example_tutorial_imageSegmentation
 [ 87%] Built target example_tutorial_pointPolygonTest_demo
 [ 87%] Built target example_tutorial_moments_demo
 Scanning dependencies of target example_tutorial_houghcircles
 Scanning dependencies of target example_tutorial_introduction_to_svm
 [ 87%] Building CXX object  samples/cpp/CMakeFiles/example_tutorial_imageSegmentation.dir/tutorial_co de/ImgTrans/imageSegmentation.cpp.o
 [ 87%] Building CXX object  samples/cpp/CMakeFiles/example_tutorial_houghcircles.dir/tutorial_code/Im gTrans/houghcircles.cpp.o
 [ 87%] Building CXX object  samples/cpp/CMakeFiles/example_tutorial_introduction_to_svm.dir/tutorial_ code/ml/introduction_to_svm/introduction_to_svm.cpp.o
 [ 87%] Linking CXX executable  ../../bin/example_tutorial_houghcircles
 [ 87%] Built target example_tutorial_houghcircles
 Scanning dependencies of target example_tutorial_copyMakeBorder_demo
 [ 87%] Building CXX object  samples/cpp/CMakeFiles/example_tutorial_copyMakeBorder_demo.dir/tutorial_ code/ImgTrans/copyMakeBorder_demo.cpp.o
 [ 87%] Linking CXX executable ../../bin/example_tutorial_introduction_to_svm
 [ 87%] Built target example_tutorial_introduction_to_svm
 Scanning dependencies of target example_tutorial_cornerHarris_Demo
 [ 87%] Building CXX object samples/cpp/CMakeFiles/example_tutorial_cornerHarris_Demo.dir/tutorial_code/TrackingMotion/cornerHarris_Demo.cpp.o
 1 error generated.
 [ 87%] Linking CXX executable ../../bin/example_tutorial_imageSegmentation
 make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1
 make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
 make[1]: *** Waiting for unfinished jobs....
 [ 87%] Built target example_tutorial_imageSegmentation
 [ 87%] Linking CXX executable ../../bin/example_tutorial_copyMakeBorder_demo
 [ 87%] Built target example_tutorial_copyMakeBorder_demo
 [ 88%] Linking CXX executable ../../bin/example_tutorial_cornerHarris_Demo
 [ 88%] Built target example_tutorial_cornerHarris_Demo
  make: *** [all] Error 2

Any kind of help would be perfect. Have a nice day.Beacause i am working on it at least 2 day. And i dont want to give up.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.300118 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO