Guest User

Untitled

a guest
Jun 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.92 KB | None | 0 0
  1. #include <opencv2/opencv.hpp>
  2.  
  3. using namespace std;
  4. using namespace cv;
  5.  
  6. int main( int argc, char** argv )
  7. {
  8. Mat src = Mat(Size(320,240),CV_64F);;
  9. namedWindow("test");
  10.  
  11. cout << "press any key to close" << endl;
  12.  
  13. while(true){
  14. randn(src,0,1.0);
  15. imshow("test",src);
  16. if(waitKey() > 0) break;
  17. }
  18. }
  19.  
  20. g++ cv.cpp -I"/usr/local/Cellar/opencv/3.4.1_5/include" -L"/usr/local/Cellar/opencv/3.4.1_5/lib/" -lopencv_core -lopencv_highgui -o cv
  21.  
  22. g++ cv.cpp -I"/usr/local/Cellar/opencv/3.4.1_5/include" -L"/usr/local/Cellar/opencv/3.4.1_5/lib/" -lopencv_core -lopencv_highgui -o cv
  23.  
  24. Undefined symbols for architecture x86_64:
  25. "cv::drawMatches(cv::_InputArray const&, std::__1::vector<cv::KeyPoint, std::__1::allocator<cv::KeyPoint> > const&, cv::_InputArray const&, std::__1::vector<cv::KeyPoint, std::__1::allocator<cv::KeyPoint> > const&, std::__1::vector<cv::DMatch, std::__1::allocator<cv::DMatch> > const&, cv::_InputOutputArray const&, cv::Scalar_<double> const&, cv::Scalar_<double> const&, std::__1::vector<char, std::__1::allocator<char> > const&, int)", referenced from:
  26. _main in cv-c462f9.o
  27. "cv::xfeatures2d::SURF::create(double, int, int, bool, bool)", referenced from:
  28. _main in cv-c462f9.o
  29. "cv::findHomography(cv::_InputArray const&, cv::_InputArray const&, int, double, cv::_OutputArray const&, int, double)", referenced from:
  30. _main in cv-c462f9.o
  31. "cv::DescriptorMatcher::DescriptorCollection::~DescriptorCollection()", referenced from:
  32. cv::FlannBasedMatcher::~FlannBasedMatcher() in cv-c462f9.o
  33. "cv::DescriptorMatcher::~DescriptorMatcher()", referenced from:
  34. cv::FlannBasedMatcher::~FlannBasedMatcher() in cv-c462f9.o
  35. "cv::FlannBasedMatcher::FlannBasedMatcher(cv::Ptr<cv::flann::IndexParams> const&, cv::Ptr<cv::flann::SearchParams> const&)", referenced from:
  36. _main in cv-c462f9.o
  37. "cv::line(cv::_InputOutputArray const&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)", referenced from:
  38. _main in cv-c462f9.o
  39. "cv::flann::IndexParams::~IndexParams()", referenced from:
  40. cv::flann::KDTreeIndexParams::~KDTreeIndexParams() in cv-c462f9.o
  41. cv::flann::SearchParams::~SearchParams() in cv-c462f9.o
  42. "cv::flann::SearchParams::SearchParams(int, float, bool)", referenced from:
  43. cv::Ptr<cv::flann::SearchParams> cv::makePtr<cv::flann::SearchParams>() in cv-c462f9.o
  44. "cv::flann::KDTreeIndexParams::KDTreeIndexParams(int)", referenced from:
  45. cv::Ptr<cv::flann::KDTreeIndexParams> cv::makePtr<cv::flann::KDTreeIndexParams>() in cv-c462f9.o
  46. "cv::imread(cv::String const&, int)", referenced from:
  47. _main in cv-c462f9.o
  48. "cv::DescriptorMatcher::match(cv::_InputArray const&, cv::_InputArray const&, std::__1::vector<cv::DMatch, std::__1::allocator<cv::DMatch> >&, cv::_InputArray const&) const", referenced from:
  49. _main in cv-c462f9.o
  50. "vtable for cv::FlannBasedMatcher", referenced from:
  51. cv::FlannBasedMatcher::~FlannBasedMatcher() in cv-c462f9.o
  52. NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  53. ld: symbol(s) not found for architecture x86_64
  54. clang: error: linker command failed with exit code 1 (use -v to see invocation)
  55.  
  56. pkg-config --libs --cflags opencv
  57.  
  58. -I/usr/local/include/opencv -I/usr/local/include -L/usr/local/lib -lopencv_dnn -lopencv_ml -lopencv_objdetect -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_imgproc -lopencv_flann -lopencv_core
  59.  
  60. g++ cv.cpp -I"/usr/local/Cellar/opencv/3.4.1_5/include" -L"/usr/local/Cellar/opencv/3.4.1_5/lib/" pkg-config --libs --cflags opencv -o cv
  61.  
  62. clang: error: unsupported option '--libs'
  63. clang: error: unsupported option '--cflags'
  64. clang: error: no such file or directory: 'pkg-config'
  65. clang: error: no such file or directory: 'opencv'
Add Comment
Please, Sign In to add comment