Porting an OpenCV C++ module to NaCl

2,095 views
Skip to first unread message

Adam Pash

unread,
Dec 7, 2013, 2:19:51 PM12/7/13
to native-cli...@googlegroups.com
Hi everybody,

I'm new to NaCl, and relatively new to C++, but I've written a simple face detection script in C++ using OpenCV. If possible, I'd like to port it to NaCl so I can run the whole thing in the browser rather than interfacing the browser with a backend via XHR (which is what I'm currently doing to perform face detection from my webcam via getUserMedia). 

Unfortunately I'm not entirely sure where to start. I've gone through both parts of the getting started tutorial, and the basics of interfacing b/w javascript and c++ makes sense. But I'm not clear where to go next to actual port my existing code.

For reference, the face detection C++ code is here:


I saw that Miguel Casas-sanchez recently ported OpenCV, so it seems like there's a path that'll get me where I'd like to go, but I'm just not entirely sure how to get there. Thanks so much for any help!

Adam

vineet jain

unread,
Dec 8, 2013, 12:48:50 PM12/8/13
to native-cli...@googlegroups.com
Well, probably a first step would be to compile the c++ code for NaCl platform(as initially for PPAPI platform & then for NaCl)

Adam Pash

unread,
Dec 9, 2013, 11:46:46 AM12/9/13
to native-cli...@googlegroups.com
Thanks Vineet. I guess that's the part I'm not sure about how to do. Here's what's working so far:

I've downloaded the NaCl port of OpenCV, and I've built specifically against that port using g++ (not the Nacl toolchain) and that's worked as expected. 

I've tried applying the Makefile from the getting started example (step 2) using the OpenCV port, but I'm getting a lot of errors (log below). It seems like my files aren't being included properly, but all the paths are the same as in the working build using g++.

Apologies if I'm missing something really obvious. I'm relatively new to C++ in general, but I'm determined to get NaCl working for this build. I really, really appreciate any and all help!

LINK newlib/Release/part2_unstripped_x86_32.nexe
newlib/Release/faces_x86_32.o: In function `detect_faces(char*, char*)':
/Users/ap/code/learning/face_det/faces.cpp:32: undefined reference to `cv::CascadeClassifier::CascadeClassifier()'
/Users/ap/code/learning/face_det/faces.cpp:33: undefined reference to `cv::CascadeClassifier::CascadeClassifier()'
/Users/ap/code/learning/face_det/faces.cpp:36: undefined reference to `cv::CascadeClassifier::load(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/Users/ap/code/learning/face_det/faces.cpp:37: undefined reference to `cv::CascadeClassifier::load(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/Users/ap/code/learning/face_det/faces.cpp:40: undefined reference to `cv::imread(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/Users/ap/code/learning/face_det/faces.cpp:43: undefined reference to `cv::noArray()'
/Users/ap/code/learning/face_det/faces.cpp:43: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
/Users/ap/code/learning/face_det/faces.cpp:43: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
/Users/ap/code/learning/face_det/faces.cpp:43: undefined reference to `cv::normalize(cv::_InputArray const&, cv::_OutputArray const&, double, double, int, int, cv::_InputArray const&)'
/Users/ap/code/learning/face_det/faces.cpp:46: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
/Users/ap/code/learning/face_det/faces.cpp:46: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
/Users/ap/code/learning/face_det/faces.cpp:46: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
/Users/ap/code/learning/face_det/faces.cpp:49: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
/Users/ap/code/learning/face_det/faces.cpp:49: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
/Users/ap/code/learning/face_det/faces.cpp:49: undefined reference to `cv::equalizeHist(cv::_InputArray const&, cv::_OutputArray const&)'
/Users/ap/code/learning/face_det/faces.cpp:58: undefined reference to `cv::CascadeClassifier::detectMultiScale(cv::Mat const&, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >&, double, int, int, cv::Size_<int>, cv::Size_<int>)'
/Users/ap/code/learning/face_det/faces.cpp:59: undefined reference to `cv::CascadeClassifier::detectMultiScale(cv::Mat const&, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >&, double, int, int, cv::Size_<int>, cv::Size_<int>)'
/Users/ap/code/learning/face_det/faces.cpp:69: undefined reference to `cv::rectangle(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
/Users/ap/code/learning/face_det/faces.cpp:74: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
/Users/ap/code/learning/face_det/faces.cpp:74: undefined reference to `cv::imwrite(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
newlib/Release/faces_x86_32.o: In function `~Mat':
/Users/ap/code/learning/nacl/naclports/src/out/repository/opencv-2.4.7/include/opencv2/core/mat.hpp:278: undefined reference to `cv::fastFree(void*)'
/Users/ap/code/learning/nacl/naclports/src/out/repository/opencv-2.4.7/include/opencv2/core/mat.hpp:278: undefined reference to `cv::fastFree(void*)'
newlib/Release/faces_x86_32.o: In function `detect_faces(char*, char*)':
/Users/ap/code/learning/face_det/faces.cpp:75: undefined reference to `cv::CascadeClassifier::~CascadeClassifier()'
/Users/ap/code/learning/face_det/faces.cpp:75: undefined reference to `cv::CascadeClassifier::~CascadeClassifier()'
newlib/Release/faces_x86_32.o: In function `~Mat':
/Users/ap/code/learning/nacl/naclports/src/out/repository/opencv-2.4.7/include/opencv2/core/mat.hpp:367: undefined reference to `cv::Mat::deallocate()'
newlib/Release/faces_x86_32.o: In function `cv::Mat::release()':
/Users/ap/code/learning/nacl/naclports/src/out/repository/opencv-2.4.7/include/opencv2/core/mat.hpp:367: undefined reference to `cv::Mat::deallocate()'
newlib/Release/faces_x86_32.o: In function `detect_faces(char*, char*)':
/Users/ap/code/learning/face_det/faces.cpp:75: undefined reference to `cv::CascadeClassifier::~CascadeClassifier()'
/Users/ap/code/learning/face_det/faces.cpp:75: undefined reference to `cv::CascadeClassifier::~CascadeClassifier()'
newlib/Release/faces_x86_32.o: In function `cv::Mat::release()':
/Users/ap/code/learning/nacl/naclports/src/out/repository/opencv-2.4.7/include/opencv2/core/mat.hpp:367: undefined reference to `cv::Mat::deallocate()'
newlib/Release/faces_x86_32.o: In function `~Mat':
/Users/ap/code/learning/nacl/naclports/src/out/repository/opencv-2.4.7/include/opencv2/core/mat.hpp:278: undefined reference to `cv::fastFree(void*)'
collect2: ld returned 1 exit status
make: *** [newlib/Release/part2_unstripped_x86_32.nexe] Error 1

Adam Pash

unread,
Dec 9, 2013, 1:19:13 PM12/9/13
to native-cli...@googlegroups.com
I'm realizing that I might not be giving enough information, so in the interest of completeness, here are the steps I've taken so far:

  1. I've verified that the SDK tools are installed/working correctly via the Getting Started example (part1 and part2).
  2. I've followed these instructions to sync naclports to my computer.
  3. I cd'ed into naclports/src/ports/opencv and ran build.sh (with the right path set for NACL_SDK_ROOT)
  4. The build script appears to have installed the OpenCV port into $NACL_SDK_ROOT/toolchain/mac_x86_newlib/i686-nacl/usr/...
Just for a very simple effort to get it building, I've just included the faces.cpp file in hello_tutorial.cc in an effort to get it to build (I've also removed the stdio stuff). When I do, I get the errors in the log above.

Sam Clegg

unread,
Dec 9, 2013, 1:34:25 PM12/9/13
to native-cli...@googlegroups.com
Hi Adam,

It looks like you are not linking against the opencv library.

Most likely you need to edit the Makefile at add "opencv" (or whatever
the lib is called) to the LIBS variable.

Also, when diagnosing problems, or sending build output to this list
it helps if add "V=1" to your make command line so that you/we can see
the full command lines.

cheers,
sam
> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to native-client-di...@googlegroups.com.
> To post to this group, send email to native-cli...@googlegroups.com.
> Visit this group at http://groups.google.com/group/native-client-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.

vineet jain

unread,
Dec 9, 2013, 1:34:35 PM12/9/13
to native-cli...@googlegroups.com
can you point to the link from where you downloaded the OpenCV port for NaCl, as i cannot locate it here : https://code.google.com/p/naclports/wiki/PortList


On Sunday, 8 December 2013 00:49:51 UTC+5:30, Adam Pash wrote:

Sam Clegg

unread,
Dec 9, 2013, 1:50:32 PM12/9/13
to native-cli...@googlegroups.com
Sorry, the PostList page is only updated periodically and the opencv
port was just added in the last few days.

All the ports live in source control so the most up-to-date list is
always available by checking out the code and looking in the 'ports'
folder:
https://code.google.com/p/naclports/wiki/HowTo_Checkout
Or just view the latest code on the web:
https://chromium.googlesource.com/external/naclports.git/+/master/ports/

cheers,
sam
Message has been deleted

Adam Pash

unread,
Dec 9, 2013, 2:10:01 PM12/9/13
to native-cli...@googlegroups.com
Thanks Sam! 

So that was definitely a problem. I added some linked libs, and now I'm getting the following errors (with "V=1" added — repost b/c I had introduced a diff error in previous post)

/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/i686-nacl-g++ -o newlib/Release/part2_unstripped_x86_32.nexe newlib/Release/hello_tutorial_x86_32.o -Wl,-as-needed -Wl,-Map,./newlib/Release/part2_x86_32.map -L/Users/ap/SDKs/nacl/pepper_31/lib/newlib_x86_32/Release -lppapi_cpp -lppapi -lopencv_imgproc -lopencv_highgui -lopencv_core -lopencv_objdetect 
newlib/Release/hello_tutorial_x86_32.o: In function `__exchange_and_add_dispatch':
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
newlib/Release/hello_tutorial_x86_32.o:/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o): In function `cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)':
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x19c): undefined reference to `jpeg_CreateCompress'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x1bc): undefined reference to `jpeg_std_error'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x39c): undefined reference to `jpeg_set_defaults'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x3bc): undefined reference to `jpeg_set_quality'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x3dc): undefined reference to `jpeg_start_compress'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x4dc): undefined reference to `jpeg_write_scanlines'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x51c): undefined reference to `jpeg_finish_compress'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x55c): undefined reference to `jpeg_destroy_compress'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x71c): undefined reference to `jpeg_stdio_dest'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x7fc): undefined reference to `jpeg_write_scanlines'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x8fc): undefined reference to `jpeg_write_scanlines'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o): In function `cv::JpegDecoder::close()':
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder5closeEv+0x3c): undefined reference to `jpeg_destroy_decompress'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o): In function `cv::JpegDecoder::readHeader()':
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder10readHeaderEv+0x7c): undefined reference to `jpeg_std_error'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder10readHeaderEv+0x15c): undefined reference to `jpeg_CreateDecompress'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder10readHeaderEv+0x1fc): undefined reference to `jpeg_stdio_src'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder10readHeaderEv+0x23c): undefined reference to `jpeg_read_header'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder10readHeaderEv+0x2e2): undefined reference to `jpeg_resync_to_restart'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o): In function `T.412':
grfmt_jpeg.cpp:(.text.T.412+0x45c): undefined reference to `jpeg_alloc_huff_table'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o): In function `cv::JpegDecoder::readData(cv::Mat&)':
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder8readDataERNS_3MatE+0x1bc): undefined reference to `jpeg_start_decompress'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder8readDataERNS_3MatE+0x2bc): undefined reference to `jpeg_read_scanlines'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder8readDataERNS_3MatE+0x37c): undefined reference to `jpeg_finish_decompress'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegDecoder8readDataERNS_3MatE+0x43c): undefined reference to `jpeg_read_scanlines'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o): In function `cv::JpegEncoder::~JpegEncoder()':
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoderD2Ev+0xc2): undefined reference to `pthread_mutex_lock'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoderD2Ev+0x122): undefined reference to `pthread_mutex_lock'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoderD2Ev+0x182): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o): In function `cv::JpegEncoder::~JpegEncoder()':
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoderD0Ev+0xe2): undefined reference to `pthread_mutex_lock'
grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoderD0Ev+0x142): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_jpeg.cpp.o):grfmt_jpeg.cpp:(.text._ZN2cv11JpegEncoderD0Ev+0x1a2): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngDecoder::readDataFromBuf(void*, unsigned char*, unsigned int)':
grfmt_png.cpp:(.text._ZN2cv10PngDecoder15readDataFromBufEPvPhj+0x5c): undefined reference to `png_get_io_ptr'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder15readDataFromBufEPvPhj+0x15c): undefined reference to `png_error'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngDecoder::close()':
grfmt_png.cpp:(.text._ZN2cv10PngDecoder5closeEv+0x9c): undefined reference to `png_destroy_read_struct'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngDecoder::readHeader()':
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x7c): undefined reference to `png_create_read_struct'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x9c): undefined reference to `png_create_info_struct'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0xbc): undefined reference to `png_create_info_struct'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x1bc): undefined reference to `png_init_io'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x23c): undefined reference to `png_read_info'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x29c): undefined reference to `png_get_IHDR'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x41c): undefined reference to `png_set_read_fn'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder10readHeaderEv+0x4bc): undefined reference to `png_get_tRNS'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)':
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x5c): undefined reference to `png_create_write_struct'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0xfc): undefined reference to `png_create_info_struct'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x17c): undefined reference to `png_set_write_fn'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x29c): undefined reference to `png_set_compression_level'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x2bc): undefined reference to `png_set_compression_strategy'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x37c): undefined reference to `png_set_IHDR'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x39c): undefined reference to `png_write_info'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x3bc): undefined reference to `png_set_packing'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x3dc): undefined reference to `png_set_bgr'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x3fc): undefined reference to `png_set_swap'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x53c): undefined reference to `png_write_image'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x55c): undefined reference to `png_write_end'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x5bc): undefined reference to `png_destroy_write_struct'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x6fc): undefined reference to `png_init_io'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x73c): undefined reference to `png_set_filter'
grfmt_png.cpp:(.text._ZN2cv10PngEncoder5writeERKNS_3MatERKSt6vectorIiSaIiEE+0x75c): undefined reference to `png_set_compression_level'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngEncoder::writeDataToBuf(void*, unsigned char*, unsigned int)':
grfmt_png.cpp:(.text._ZN2cv10PngEncoder14writeDataToBufEPvPhj+0x7c): undefined reference to `png_get_io_ptr'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngEncoder::~PngEncoder()':
grfmt_png.cpp:(.text._ZN2cv10PngEncoderD0Ev+0xe2): undefined reference to `pthread_mutex_lock'
grfmt_png.cpp:(.text._ZN2cv10PngEncoderD0Ev+0x142): undefined reference to `pthread_mutex_lock'
grfmt_png.cpp:(.text._ZN2cv10PngEncoderD0Ev+0x1a2): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngEncoder::~PngEncoder()':
grfmt_png.cpp:(.text._ZN2cv10PngEncoderD1Ev+0xc2): undefined reference to `pthread_mutex_lock'
grfmt_png.cpp:(.text._ZN2cv10PngEncoderD1Ev+0x122): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_png.cpp.o):grfmt_png.cpp:(.text._ZN2cv10PngEncoderD1Ev+0x182): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_png.cpp.o): In function `cv::PngDecoder::readData(cv::Mat&)':
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x29c): undefined reference to `png_set_bgr'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x2bc): undefined reference to `png_set_interlace_handling'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x2dc): undefined reference to `png_read_update_info'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x33c): undefined reference to `png_read_image'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x35c): undefined reference to `png_read_end'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x39c): undefined reference to `png_set_gray_to_rgb'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x3fc): undefined reference to `png_set_rgb_to_gray'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x43c): undefined reference to `png_set_strip_alpha'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x47c): undefined reference to `png_set_swap'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x4bc): undefined reference to `png_set_expand_gray_1_2_4_to_8'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x4fc): undefined reference to `png_set_strip_16'
grfmt_png.cpp:(.text._ZN2cv10PngDecoder8readDataERNS_3MatE+0x53c): undefined reference to `png_set_palette_to_rgb'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_pxm.cpp.o): In function `cv::PxMEncoder::~PxMEncoder()':
grfmt_pxm.cpp:(.text._ZN2cv10PxMEncoderD2Ev+0xc2): undefined reference to `pthread_mutex_lock'
grfmt_pxm.cpp:(.text._ZN2cv10PxMEncoderD2Ev+0x122): undefined reference to `pthread_mutex_lock'
grfmt_pxm.cpp:(.text._ZN2cv10PxMEncoderD2Ev+0x182): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_pxm.cpp.o): In function `cv::PxMEncoder::~PxMEncoder()':
grfmt_pxm.cpp:(.text._ZN2cv10PxMEncoderD0Ev+0xe2): undefined reference to `pthread_mutex_lock'
grfmt_pxm.cpp:(.text._ZN2cv10PxMEncoderD0Ev+0x142): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_pxm.cpp.o):grfmt_pxm.cpp:(.text._ZN2cv10PxMEncoderD0Ev+0x1a2): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o): In function `cv::TiffDecoder::close()':
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder5closeEv+0x3c): undefined reference to `TIFFClose'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o): In function `cv::TiffDecoder::readHeader()':
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder10readHeaderEv+0x5c): undefined reference to `TIFFOpen'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder10readHeaderEv+0x9c): undefined reference to `TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder10readHeaderEv+0x13c): undefined reference to `TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder10readHeaderEv+0x15c): undefined reference to `TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder10readHeaderEv+0x19c): undefined reference to `TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder10readHeaderEv+0x1bc): undefined reference to `TIFFGetField'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o): In function `cv::TiffDecoder::readData(cv::Mat&)':
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x15c): undefined reference to `TIFFIsTiled'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x19c): undefined reference to `TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x1fc): undefined reference to `TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x21c): undefined reference to `TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x29c): undefined reference to `TIFFGetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x47c): undefined reference to `TIFFGetField'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o):grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x4bc): more undefined references to `TIFFGetField' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o): In function `cv::TiffDecoder::readData(cv::Mat&)':
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x53c): undefined reference to `TIFFReadEncodedStrip'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x6dc): undefined reference to `TIFFReadEncodedStrip'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0x9dc): undefined reference to `TIFFReadRGBAStrip'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0xb9c): undefined reference to `TIFFReadRGBATile'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0xbfc): undefined reference to `TIFFReadEncodedTile'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0xc5c): undefined reference to `TIFFReadEncodedTile'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoder8readDataERNS_3MatE+0xc9c): undefined reference to `TIFFRGBAImageOK'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o): In function `cv::TiffDecoder::TiffDecoder()':
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoderC1Ev+0x9c): undefined reference to `TIFFSetErrorHandler'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoderC1Ev+0xbc): undefined reference to `TIFFSetWarningHandler'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o): In function `cv::TiffDecoder::TiffDecoder()':
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoderC2Ev+0x9c): undefined reference to `TIFFSetErrorHandler'
grfmt_tiff.cpp:(.text._ZN2cv11TiffDecoderC2Ev+0xbc): undefined reference to `TIFFSetWarningHandler'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o): In function `cv::TiffEncoder::writeLibTiff(cv::Mat const&, std::vector<int, std::allocator<int> > const&)':
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x1bc): undefined reference to `TIFFOpen'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x2fc): undefined reference to `TIFFSetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x33c): undefined reference to `TIFFClose'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x43c): undefined reference to `TIFFSetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x47c): undefined reference to `TIFFSetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x4bc): undefined reference to `TIFFSetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x4dc): undefined reference to `TIFFSetField'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x51c): undefined reference to `TIFFSetField'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o):grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x55c): more undefined references to `TIFFSetField' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o): In function `cv::TiffEncoder::writeLibTiff(cv::Mat const&, std::vector<int, std::allocator<int> > const&)':
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x5dc): undefined reference to `TIFFScanlineSize'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x6bc): undefined reference to `TIFFClose'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x77c): undefined reference to `TIFFWriteScanline'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x7bc): undefined reference to `TIFFClose'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoder12writeLibTiffERKNS_3MatERKSt6vectorIiSaIiEE+0x9dc): undefined reference to `TIFFClose'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o): In function `cv::TiffEncoder::~TiffEncoder()':
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoderD0Ev+0xe2): undefined reference to `pthread_mutex_lock'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoderD0Ev+0x142): undefined reference to `pthread_mutex_lock'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoderD0Ev+0x1a2): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o): In function `cv::TiffEncoder::~TiffEncoder()':
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoderD1Ev+0xc2): undefined reference to `pthread_mutex_lock'
grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoderD1Ev+0x122): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_highgui.a(grfmt_tiff.cpp.o):grfmt_tiff.cpp:(.text._ZN2cv11TiffEncoderD1Ev+0x182): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvGets(CvFileStorage*, char*, int)':
persistence.cpp:(.text._ZL7icvGetsP13CvFileStoragePci+0x21c): undefined reference to `gzgets'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvXMLSkipSpaces(CvFileStorage*, char*, int)':
persistence.cpp:(.text._ZL16icvXMLSkipSpacesP13CvFileStoragePci+0x41c): undefined reference to `gzeof'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `T.3326':
persistence.cpp:(.text.T.3326+0x2bc): undefined reference to `gzeof'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvPuts(CvFileStorage*, char const*)':
persistence.cpp:(.text._ZL7icvPutsP13CvFileStoragePKc+0x39c): undefined reference to `gzputs'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `T.3327':
persistence.cpp:(.text.T.3327+0x5c): undefined reference to `pthread_mutex_lock'
persistence.cpp:(.text.T.3327+0x3d4): undefined reference to `pthread_mutex_lock'
persistence.cpp:(.text.T.3327+0x5fc): undefined reference to `pthread_mutex_lock'
persistence.cpp:(.text.T.3327+0x814): undefined reference to `pthread_mutex_lock'
persistence.cpp:(.text.T.3327+0x8a2): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o):persistence.cpp:(.text.T.3327+0x962): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvClose(CvFileStorage*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
persistence.cpp:(.text._ZL8icvCloseP13CvFileStoragePSs+0x39c): undefined reference to `gzclose'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `cv::FileStorage::~FileStorage()':
persistence.cpp:(.text._ZN2cv11FileStorageD0Ev+0x222): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `cv::FileStorage::~FileStorage()':
persistence.cpp:(.text._ZN2cv11FileStorageD1Ev+0x202): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `cv::FileStorage::~FileStorage()':
persistence.cpp:(.text._ZN2cv11FileStorageD2Ev+0x202): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `cvWriteReal':
persistence.cpp:(.text.cvWriteReal+0x402): undefined reference to `pthread_mutex_lock'
persistence.cpp:(.text.cvWriteReal+0x462): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o):persistence.cpp:(.text.cvWriteReal+0x4c2): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `cvOpenFileStorage':
persistence.cpp:(.text.cvOpenFileStorage+0xc9c): undefined reference to `gzrewind'
persistence.cpp:(.text.cvOpenFileStorage+0xe54): undefined reference to `pthread_mutex_lock'
persistence.cpp:(.text.cvOpenFileStorage+0x1094): undefined reference to `pthread_mutex_lock'
persistence.cpp:(.text.cvOpenFileStorage+0x117c): undefined reference to `gzclose'
persistence.cpp:(.text.cvOpenFileStorage+0x12bc): undefined reference to `gzopen'
persistence.cpp:(.text.cvOpenFileStorage+0x223c): undefined reference to `gzclose'
persistence.cpp:(.text.cvOpenFileStorage+0x27a2): undefined reference to `pthread_mutex_lock'
persistence.cpp:(.text.cvOpenFileStorage+0x2822): undefined reference to `pthread_mutex_lock'
persistence.cpp:(.text.cvOpenFileStorage+0x2902): undefined reference to `pthread_mutex_lock'
persistence.cpp:(.text.cvOpenFileStorage+0x2d82): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `.L4840':
persistence.cpp:(.text._ZL16icvWriteFileNodeP13CvFileStoragePKcPK10CvFileNode+0x582): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o):persistence.cpp:(.text._ZL16icvWriteFileNodeP13CvFileStoragePKcPK10CvFileNode+0x6e2): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(rand.cpp.o): In function `cv::theRNG()':
rand.cpp:(.text._ZN2cv6theRNGEv+0x5c): undefined reference to `pthread_once'
rand.cpp:(.text._ZN2cv6theRNGEv+0x7c): undefined reference to `pthread_getspecific'
rand.cpp:(.text._ZN2cv6theRNGEv+0xfc): undefined reference to `pthread_setspecific'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(rand.cpp.o): In function `cv::makeRNGKey()':
rand.cpp:(.text._ZN2cvL10makeRNGKeyEv+0x5c): undefined reference to `pthread_key_create'
rand.cpp:(.text._ZN2cvL10makeRNGKeyEv+0x1f1): undefined reference to `pthread_mutex_lock'
rand.cpp:(.text._ZN2cvL10makeRNGKeyEv+0x262): undefined reference to `pthread_mutex_lock'
rand.cpp:(.text._ZN2cvL10makeRNGKeyEv+0x2c2): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(rand.cpp.o): In function `cv::randShuffle(cv::_OutputArray const&, double, cv::RNG*)':
rand.cpp:(.text._ZN2cv11randShuffleERKNS_12_OutputArrayEdPNS_3RNGE+0x534): undefined reference to `pthread_mutex_lock'
rand.cpp:(.text._ZN2cv11randShuffleERKNS_12_OutputArrayEdPNS_3RNGE+0x642): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(rand.cpp.o):rand.cpp:(.text._ZN2cv11randShuffleERKNS_12_OutputArrayEdPNS_3RNGE+0x6c2): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::trylock()':
system.cpp:(.text._ZN2cv5Mutex7trylockEv+0x3c): undefined reference to `pthread_mutex_trylock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::unlock()':
system.cpp:(.text._ZN2cv5Mutex6unlockEv+0x3c): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::lock()':
system.cpp:(.text._ZN2cv5Mutex4lockEv+0x3c): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::operator=(cv::Mutex const&)':
system.cpp:(.text._ZN2cv5MutexaSERKS0_+0x9c): undefined reference to `pthread_mutex_destroy'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::~Mutex()':
system.cpp:(.text._ZN2cv5MutexD1Ev+0x7c): undefined reference to `pthread_mutex_destroy'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::~Mutex()':
system.cpp:(.text._ZN2cv5MutexD2Ev+0x7c): undefined reference to `pthread_mutex_destroy'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::Mutex()':
system.cpp:(.text._ZN2cv5MutexC1Ev+0x5c): undefined reference to `pthread_mutex_init'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o): In function `cv::Mutex::Mutex()':
system.cpp:(.text._ZN2cv5MutexC2Ev+0x5c): undefined reference to `pthread_mutex_init'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o): In function `cv::Exception::~Exception()':
system.cpp:(.text._ZN2cv9ExceptionD0Ev+0x122): undefined reference to `pthread_mutex_lock'
system.cpp:(.text._ZN2cv9ExceptionD0Ev+0x182): undefined reference to `pthread_mutex_lock'
system.cpp:(.text._ZN2cv9ExceptionD0Ev+0x1e2): undefined reference to `pthread_mutex_lock'
system.cpp:(.text._ZN2cv9ExceptionD0Ev+0x242): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o): In function `cv::Exception::~Exception()':
system.cpp:(.text._ZN2cv9ExceptionD1Ev+0x102): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(system.cpp.o):system.cpp:(.text._ZN2cv9ExceptionD1Ev+0x162): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(cascadedetect.cpp.o): In function `cv::CascadeClassifier::detectMultiScale(cv::Mat const&, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >&, std::vector<int, std::allocator<int> >&, std::vector<double, std::allocator<double> >&, double, int, int, cv::Size_<int>, cv::Size_<int>, bool)':
cascadedetect.cpp:(.text._ZN2cv17CascadeClassifier16detectMultiScaleERKNS_3MatERSt6vectorINS_5Rect_IiEESaIS6_EERS4_IiSaIiEERS4_IdSaIdEEdiiNS_5Size_IiEESH_b+0x9bc): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
cascadedetect.cpp:(.text._ZN2cv17CascadeClassifier16detectMultiScaleERKNS_3MatERSt6vectorINS_5Rect_IiEESaIS6_EERS4_IiSaIiEERS4_IdSaIdEEdiiNS_5Size_IiEESH_b+0x14c2): undefined reference to `pthread_mutex_lock'
cascadedetect.cpp:(.text._ZN2cv17CascadeClassifier16detectMultiScaleERKNS_3MatERSt6vectorINS_5Rect_IiEESaIS6_EERS4_IiSaIiEERS4_IdSaIdEEdiiNS_5Size_IiEESH_b+0x1522): undefined reference to `pthread_mutex_lock'
cascadedetect.cpp:(.text._ZN2cv17CascadeClassifier16detectMultiScaleERKNS_3MatERSt6vectorINS_5Rect_IiEESaIS6_EERS4_IiSaIiEERS4_IdSaIdEEdiiNS_5Size_IiEESH_b+0x1582): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(haar.cpp.o): In function `cvLoadHaarClassifierCascade':
haar.cpp:(.text.cvLoadHaarClassifierCascade+0x3b0): undefined reference to `pthread_mutex_lock'
haar.cpp:(.text.cvLoadHaarClassifierCascade+0x838): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(haar.cpp.o):haar.cpp:(.text.cvLoadHaarClassifierCascade+0x19c2): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(haar.cpp.o): In function `cvHaarDetectObjectsForROC(void const*, CvHaarClassifierCascade*, CvMemStorage*, std::vector<int, std::allocator<int> >&, std::vector<double, std::allocator<double> >&, double, int, int, CvSize, CvSize, bool)':
haar.cpp:(.text._Z25cvHaarDetectObjectsForROCPKvP23CvHaarClassifierCascadeP12CvMemStorageRSt6vectorIiSaIiEERS5_IdSaIdEEdii6CvSizeSC_b+0x145c): undefined reference to `cvResize'
haar.cpp:(.text._Z25cvHaarDetectObjectsForROCPKvP23CvHaarClassifierCascadeP12CvMemStorageRSt6vectorIiSaIiEERS5_IdSaIdEEdii6CvSizeSC_b+0x311c): undefined reference to `cvCanny'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(haar.cpp.o): In function `icvReadHaarClassifier(CvFileStorage*, CvFileNode*)':
haar.cpp:(.text._ZL21icvReadHaarClassifierP13CvFileStorageP10CvFileNode+0x1174): undefined reference to `pthread_mutex_lock'
haar.cpp:(.text._ZL21icvReadHaarClassifierP13CvFileStorageP10CvFileNode+0x3a34): undefined reference to `pthread_mutex_lock'
haar.cpp:(.text._ZL21icvReadHaarClassifierP13CvFileStorageP10CvFileNode+0x3c34): undefined reference to `pthread_mutex_lock'
haar.cpp:(.text._ZL21icvReadHaarClassifierP13CvFileStorageP10CvFileNode+0x3ca2): undefined reference to `pthread_mutex_lock'
haar.cpp:(.text._ZL21icvReadHaarClassifierP13CvFileStorageP10CvFileNode+0x3ce2): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(haar.cpp.o):haar.cpp:(.text._ZL21icvReadHaarClassifierP13CvFileStorageP10CvFileNode+0x3d42): more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(locale.o): In function `__gthread_mutex_unlock':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/x86_64-nacl/bits/gthr-default.h:534: undefined reference to `pthread_mutex_unlock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/x86_64-nacl/bits/gthr-default.h:534: undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(locale.o): In function `__atomic_add_dispatch':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:92: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(locale.o): In function `__exchange_and_add_dispatch':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(locale.o):/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(locale_init.o): In function `__gnu_cxx::__scoped_lock::~__scoped_lock()':
locale_init.cc:(.text._ZN9__gnu_cxx13__scoped_lockD1Ev[__gnu_cxx::__scoped_lock::~__scoped_lock()]+0x1c): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(locale_init.o): In function `std::locale::_S_initialize()':
locale_init.cc:(.text._ZNSt6locale13_S_initializeEv+0x2): undefined reference to `pthread_mutex_lock'
locale_init.cc:(.text._ZNSt6locale13_S_initializeEv+0x3c): undefined reference to `pthread_once'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(locale_init.o): In function `std::locale::locale()':
locale_init.cc:(.text._ZNSt6localeC1Ev+0x43): undefined reference to `pthread_mutex_lock'
locale_init.cc:(.text._ZNSt6localeC1Ev+0x5c): undefined reference to `pthread_mutex_lock'
locale_init.cc:(.text._ZNSt6localeC1Ev+0x7c): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(locale_init.o): In function `std::locale::locale()':
locale_init.cc:(.text._ZNSt6localeC2Ev+0x43): undefined reference to `pthread_mutex_lock'
locale_init.cc:(.text._ZNSt6localeC2Ev+0x5c): undefined reference to `pthread_mutex_lock'
locale_init.cc:(.text._ZNSt6localeC2Ev+0x7c): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(locale_init.o): In function `std::locale::global(std::locale const&)':
locale_init.cc:(.text._ZNSt6locale6globalERKS_+0x7): undefined reference to `pthread_mutex_lock'
locale_init.cc:(.text._ZNSt6locale6globalERKS_+0x5c): undefined reference to `pthread_mutex_lock'
locale_init.cc:(.text._ZNSt6locale6globalERKS_+0x11c): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(stdexcept.o): In function `__exchange_and_add_dispatch':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(stdexcept.o):/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(eh_alloc.o): In function `__cxa_free_dependent_exception':
eh_alloc.cc:(.text.__cxa_free_dependent_exception+0x9c): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(eh_alloc.o): In function `__cxa_free_exception':
eh_alloc.cc:(.text.__cxa_free_exception+0x47): undefined reference to `pthread_mutex_lock'
eh_alloc.cc:(.text.__cxa_free_exception+0x5c): undefined reference to `pthread_mutex_lock'
eh_alloc.cc:(.text.__cxa_free_exception+0x7c): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_exception':
eh_alloc.cc:(.text.__cxa_allocate_exception+0x121): undefined reference to `pthread_mutex_lock'
eh_alloc.cc:(.text.__cxa_allocate_exception+0x13c): undefined reference to `pthread_mutex_lock'
eh_alloc.cc:(.text.__cxa_allocate_exception+0x1fc): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_dependent_exception':
eh_alloc.cc:(.text.__cxa_allocate_dependent_exception+0xa1): undefined reference to `pthread_mutex_lock'
eh_alloc.cc:(.text.__cxa_allocate_dependent_exception+0xbc): undefined reference to `pthread_mutex_lock'
eh_alloc.cc:(.text.__cxa_allocate_dependent_exception+0x15c): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(eh_globals.o): In function `__eh_globals_init':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libstdc++-v3/libsupc++/eh_globals.cc:98: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(eh_globals.o): In function `__gthread_key_create':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/x86_64-nacl/bits/gthr-default.h:491: undefined reference to `pthread_key_create'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(eh_globals.o): In function `__gthread_getspecific':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/x86_64-nacl/bits/gthr-default.h:503: undefined reference to `pthread_getspecific'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(eh_globals.o): In function `__gthread_setspecific':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/x86_64-nacl/bits/gthr-default.h:509: undefined reference to `pthread_setspecific'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(eh_globals.o): In function `__gthread_getspecific':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/x86_64-nacl/bits/gthr-default.h:503: undefined reference to `pthread_getspecific'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(guard.o): In function `(anonymous namespace)::init()':
guard.cc:(.text._ZN12_GLOBAL__N_1L4initEv+0x2): undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(guard.o): In function `__cxa_guard_release':
guard.cc:(.text.__cxa_guard_release+0x11): undefined reference to `pthread_mutex_lock'
guard.cc:(.text.__cxa_guard_release+0x3c): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(guard.o): In function `__cxa_guard_abort':
guard.cc:(.text.__cxa_guard_abort+0xe): undefined reference to `pthread_mutex_lock'
guard.cc:(.text.__cxa_guard_abort+0x3c): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(guard.o): In function `__cxa_guard_acquire':
guard.cc:(.text.__cxa_guard_acquire+0x16): undefined reference to `pthread_mutex_lock'
guard.cc:(.text.__cxa_guard_acquire+0x3c): undefined reference to `pthread_once'
guard.cc:(.text.__cxa_guard_acquire+0x5c): undefined reference to `pthread_mutex_lock'
guard.cc:(.text.__cxa_guard_acquire+0x9c): undefined reference to `pthread_mutex_unlock'
guard.cc:(.text.__cxa_guard_acquire+0x1bc): undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(ios.o): In function `std::ios_base::_M_dispose_callbacks()':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libstdc++-v3/src/ios.cc:181: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(ios.o): In function `__exchange_and_add_dispatch':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/32/libgcc.a(unwind-dw2.o): In function `__gthread_once':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:123: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:483: undefined reference to `pthread_once'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/32/libgcc.a(unwind-dw2-fde-glibc.o): In function `__gthread_mutex_lock':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:123: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:516: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/32/libgcc.a(unwind-dw2-fde-glibc.o): In function `__gthread_mutex_unlock':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:123: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:534: undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/32/libgcc.a(unwind-dw2-fde-glibc.o): In function `__gthread_mutex_lock':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:123: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:516: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/32/libgcc.a(unwind-dw2-fde-glibc.o): In function `__gthread_mutex_unlock':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:534: undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/32/libgcc.a(unwind-dw2-fde-glibc.o): In function `__gthread_mutex_lock':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:123: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:516: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/32/libgcc.a(unwind-dw2-fde-glibc.o): In function `__gthread_mutex_unlock':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:123: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:534: undefined reference to `pthread_mutex_unlock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/32/libgcc.a(unwind-dw2-fde-glibc.o): In function `__gthread_mutex_lock':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:123: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:516: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/32/libgcc.a(unwind-dw2-fde-glibc.o): In function `__gthread_mutex_unlock':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/SRC/gcc/libgcc/../gcc/gthr-nacl.h:534: undefined reference to `pthread_mutex_unlock'
collect2: ld returned 1 exit status
make: *** [newlib/Release/part2_unstripped_x86_32.nexe] Error 1

Sam Clegg

unread,
Dec 9, 2013, 2:20:07 PM12/9/13
to native-cli...@googlegroups.com
Looks like you need to add more libraries. png, tiff and jpeg would
be good start.

For the missing pthread functions, you can either add 'pthread' to the
list of libs or, more correctly, you can add '-pthread' to LDFLAGS.
>> > email to native-client-di...@googlegroups.com.
>> > To post to this group, send email to native-cli...@googlegroups.com.
>> > Visit this group at
>> > http://groups.google.com/group/native-client-discuss.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to native-client-di...@googlegroups.com.

Sam Clegg

unread,
Dec 9, 2013, 2:22:05 PM12/9/13
to native-cli...@googlegroups.com
For the extra image libraries you will also need to build them from naclports.
The easiest way do this if to run, for example, "make jpeg" in the
naclports/src folder.

Adam Pash

unread,
Dec 9, 2013, 3:50:24 PM12/9/13
to native-cli...@googlegroups.com
Thanks again Sam! Apologies if this is really obvious stuff. 

Okay, so I've built the image libraries and they seem to be included correctly now. I'm still getting the pthread (and other) errors, but it's certainly possible I haven't added it correctly. Here's what my Makefile currently looks like:


Here's the current log:

/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/i686-nacl-g++ -o newlib/Release/part2_unstripped_x86_32.nexe newlib/Release/hello_tutorial_x86_32.o -Wl,-as-needed -Wl,-Map,./newlib/Release/part2_x86_32.map -L/Users/ap/SDKs/nacl/pepper_31/lib/newlib_x86_32/Release -lppapi_cpp -lppapi -lopencv_imgproc -lopencv_highgui -lopencv_core -lopencv_objdetect -lpng -ltiff -ljpeg 
newlib/Release/hello_tutorial_x86_32.o: In function `__exchange_and_add_dispatch':
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
newlib/Release/hello_tutorial_x86_32.o:/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/include/c++/4.4.3/ext/atomicity.h:78: more undefined references to `pthread_mutex_lock' follow
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-png.o): In function `png_calculate_crc':
png.c:(.text+0x169c): undefined reference to `crc32'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-png.o): In function `png_reset_crc':
png.c:(.text+0x173c): undefined reference to `crc32'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-png.o): In function `png_reset_zstream':
png.c:(.text+0x599): undefined reference to `inflateReset'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngread.o): In function `png_read_destroy':
pngread.c:(.text+0x49c): undefined reference to `inflateEnd'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngread.o): In function `png_read_row':
pngread.c:(.text+0x12bc): undefined reference to `inflate'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngread.o): In function `png_read_init_3':
pngread.c:(.text+0x315c): undefined reference to `inflateInit_'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngread.o): In function `png_create_read_struct_2':
pngread.c:(.text+0x389c): undefined reference to `inflateInit_'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngwrite.o): In function `png_write_destroy':
pngwrite.c:(.text+0xdbc): undefined reference to `deflateEnd'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngwrite.o): In function `png_write_flush':
pngwrite.c:(.text+0x121c): undefined reference to `deflate'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngrutil.o): In function `png_decompress_chunk':
pngrutil.c:(.text+0x1a3c): undefined reference to `inflate'
pngrutil.c:(.text+0x1b5c): undefined reference to `inflateReset'
pngrutil.c:(.text+0x1bdc): undefined reference to `inflateReset'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngrutil.o): In function `png_read_finish_row':
pngrutil.c:(.text+0x249c): undefined reference to `inflate'
pngrutil.c:(.text+0x273c): undefined reference to `inflateReset'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngwutil.o): In function `png_text_compress':
pngwutil.c:(.text+0x9fc): undefined reference to `deflate'
pngwutil.c:(.text+0xb1c): undefined reference to `deflate'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngwutil.o): In function `png_write_compressed_data_out':
pngwutil.c:(.text+0x16fc): undefined reference to `deflateReset'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngwutil.o): In function `png_write_finish_row':
pngwutil.c:(.text+0x3c9c): undefined reference to `deflate'
pngwutil.c:(.text+0x3e3c): undefined reference to `deflateReset'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngwutil.o): In function `png_write_filtered_row':
pngwutil.c:(.text+0x405c): undefined reference to `deflate'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libpng.a(libpng12_la-pngwutil.o): In function `png_write_IHDR':
pngwutil.c:(.text+0x5a5c): undefined reference to `deflateInit2_'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_pixarlog.o): In function `PixarLogVSetField':
tif_pixarlog.c:(.text+0xcdc): undefined reference to `deflateParams'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_pixarlog.o): In function `PixarLogCleanup':
tif_pixarlog.c:(.text+0x109c): undefined reference to `inflateEnd'
tif_pixarlog.c:(.text+0x10dc): undefined reference to `deflateEnd'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_pixarlog.o): In function `PixarLogPostEncode':
tif_pixarlog.c:(.text+0x117c): undefined reference to `deflate'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_pixarlog.o): In function `PixarLogEncode':
tif_pixarlog.c:(.text+0x1c3c): undefined reference to `deflate'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_pixarlog.o): In function `PixarLogPreEncode':
tif_pixarlog.c:(.text+0x35fc): undefined reference to `deflateReset'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_pixarlog.o): In function `PixarLogSetupEncode':
tif_pixarlog.c:(.text+0x379c): undefined reference to `deflateInit_'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_pixarlog.o): In function `PixarLogDecode':
tif_pixarlog.c:(.text+0x3a3c): undefined reference to `inflate'
tif_pixarlog.c:(.text+0x3c1c): undefined reference to `inflateSync'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_pixarlog.o): In function `PixarLogPreDecode':
tif_pixarlog.c:(.text+0x563c): undefined reference to `inflateReset'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_pixarlog.o): In function `PixarLogSetupDecode':
tif_pixarlog.c:(.text+0x57dc): undefined reference to `inflateInit_'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_zip.o): In function `ZIPCleanup':
tif_zip.c:(.text+0x39c): undefined reference to `inflateEnd'
tif_zip.c:(.text+0x3dc): undefined reference to `deflateEnd'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_zip.o): In function `ZIPEncode':
tif_zip.c:(.text+0x4bc): undefined reference to `deflate'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_zip.o): In function `ZIPPostEncode':
tif_zip.c:(.text+0x63c): undefined reference to `deflate'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_zip.o): In function `ZIPPreEncode':
tif_zip.c:(.text+0x75c): undefined reference to `deflateReset'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_zip.o): In function `ZIPSetupEncode':
tif_zip.c:(.text+0x81c): undefined reference to `deflateInit_'
tif_zip.c:(.text+0x87c): undefined reference to `inflateEnd'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_zip.o): In function `ZIPDecode':
tif_zip.c:(.text+0x9bc): undefined reference to `inflate'
tif_zip.c:(.text+0xa9c): undefined reference to `inflateSync'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_zip.o): In function `ZIPPreDecode':
tif_zip.c:(.text+0xc9c): undefined reference to `inflateReset'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_zip.o): In function `ZIPSetupDecode':
tif_zip.c:(.text+0xd9c): undefined reference to `inflateInit_'
tif_zip.c:(.text+0xdfc): undefined reference to `deflateEnd'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libtiff.a(tif_zip.o): In function `ZIPVSetField':
tif_zip.c:(.text+0xf9c): undefined reference to `deflateParams'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(functexcept.o): In function `__exchange_and_add_dispatch':
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: undefined reference to `pthread_mutex_lock'
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/lib/../lib32/libstdc++.a(functexcept.o):/Volumes/data/b/build/slave/mac-toolchain_x86/build/native_client/tools/BUILD/build-gcc-x86_64-nacl/x86_64-nacl/32/libstdc++-v3/include/ext/atomicity.h:78: more undefined references to `pthread_mutex_lock' follow
For one, I'm assuming that there are more libraries I'm missing, but: How do I go about finding which libraries need installing that aren't?

Thanks again, Sam. Really appreciate the hand-holding. 
>>> > To post to this group, send email to native-cli...@googlegroups.com.
>>> > Visit this group at
>>> > http://groups.google.com/group/native-client-discuss.
>>> > For more options, visit https://groups.google.com/groups/opt_out.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Native-Client-Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an

Sam Clegg

unread,
Dec 9, 2013, 4:27:31 PM12/9/13
to native-cli...@googlegroups.com
One way to find out which libraries opencv depends on look at its
dependencies in the top level naclports Makefile. It looks like you
are now missing only zlib and pthreads.

If you try to link a library and it is not installed in your toolchain
you should get a clear error message about the library not being
found.

cheers
sa,
>> >>> > email to native-client-di...@googlegroups.com.
>> >>> > To post to this group, send email to native-cli...@googlegroups.com.
>> >>> > Visit this group at
>> >>> > http://groups.google.com/group/native-client-discuss.
>> >>> > For more options, visit https://groups.google.com/groups/opt_out.
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "Native-Client-Discuss" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send
>> >> an
>> >> email to native-client-di...@googlegroups.com.
>> >> To post to this group, send email to native-cli...@googlegroups.com.
>> >> Visit this group at
>> >> http://groups.google.com/group/native-client-discuss.
>> >> For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to native-client-di...@googlegroups.com.

Adam Pash

unread,
Dec 9, 2013, 6:27:27 PM12/9/13
to native-cli...@googlegroups.com
Still not having any luck, I've decided to simplify my Makefile so I have a better idea what's going on/what's possibly going wrong. Here's what the Makfile looks like so far:

INCLUDES=-I$(NACL_SDK_ROOT)/include -L$(NACL_SDK_ROOT)/lib/pnacl/Release \
-I$(NACL_SDK_ROOT)/toolchain/mac_x86_newlib/i686-nacl/usr/include
 
LIBS:= -lppapi_cpp -lppapi \
-lpthread \
-lopencv_imgproc -lopencv_highgui -lopencv_core -lopencv_objdetect \
-lpng -ltiff -ljpeg -lzlib
 
all:
$(NACL_SDK_ROOT)/toolchain/mac_pnacl/bin/pnacl-clang++ hello_tutorial.cc \
$(INCLUDES) -o hello.pexe $(LIBS)

Here's the output of that:

/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang++ hello_tutorial.cc \
-I/Users/ap/SDKs/nacl/pepper_31/include -L/Users/ap/SDKs/nacl/pepper_31/lib/pnacl/Release -I/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/include -o hello.pexe -lppapi_cpp -lppapi -lpthread -lopencv_imgproc -lopencv_highgui -lopencv_core -lopencv_objdetect -lpng -ltiff -ljpeg -lzlib
pnacl-ld: Cannot find '-lopencv_imgproc'
make: *** [all] Error 255

There's something I'm not getting right re: linking libraries. I know that the OpenCV port installs to /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/include when I run build.sh, so... any idea what I'm missing here?
>> >> /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/../lib/gcc/x86_64-nacl/4.4.3/32/libgc...

Sam Clegg

unread,
Dec 9, 2013, 6:34:08 PM12/9/13
to native-cli...@googlegroups.com
You seem to be building with the PNaCl toolchain now, so you need to
build opencv for PNaCl too:

(naclports/src) $ NACL_ARCH=pnacl make opencv

Also you don't want to be adding the newlib toolchain include path
(each toolchain has its own internal include path which is
automatically included).

cheers,
sam

The Floating Brain

unread,
Dec 9, 2013, 7:22:01 PM12/9/13
to native-cli...@googlegroups.com
I am so excited to hear this about this! Please forgive me for being off topic, but I have been planing to port OpenCV myself for a while, do you happen to know if the interaction with the webcam is already implemented?

Sam Clegg

unread,
Dec 9, 2013, 8:02:19 PM12/9/13
to native-cli...@googlegroups.com
Great, good to hear that naclports is proving useful to you!

The initial commit of opencv was done here:
https://code.google.com/p/naclports/source/detail?r=993

I don't see any PPAPI calls in the patch so I doubt very much there is
any webcam interaction code in the library itself. You might want top
get in touch with mca...@chromium.org who contributed the patch.

cheers,
sam

Adam Pash

unread,
Dec 10, 2013, 9:34:41 AM12/10/13
to native-cli...@googlegroups.com
Ahhh, okay, that makes sense. Thanks Sam, will be back at it again this morning.  

I know that PNaCl seems like it's the future of NaCl, yeah? Is there any performance hit between PNaCl and one of the other NaCl toolchains? (Other than translation time)

Adam Pash

unread,
Dec 10, 2013, 10:30:00 AM12/10/13
to native-cli...@googlegroups.com
Update: Tried making with pnacl and got the following error:

@@@BUILD_STEP pnacl newlib zlib@@@
python build_tools/naclports.py check -C ports/zlib
if python build_tools/naclports.py enabled -C ports/zlib; then \
cd ports/zlib && NACL_ARCH=pnacl NACL_GLIBC= ./build.sh; fi
cp -r /Users/ap/SDKs/nacl/pepper_31/include/pnacl/arpa /Users/ap/SDKs/nacl/pepper_31/include/pnacl/netdb.h /Users/ap/SDKs/nacl/pepper_31/include/pnacl/netinet /Users/ap/SDKs/nacl/pepper_31/include/pnacl/netinet6 /Users/ap/SDKs/nacl/pepper_31/include/pnacl/poll.h /Users/ap/SDKs/nacl/pepper_31/include/pnacl/sys /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/usr/include
sha1check.py: zlib-1.2.3.tar.gz verified
######################################################################
Skipping extract step
######################################################################
######################################################################
Skipping patch step
######################################################################
Removing ztest34327.c
Removing ztest34327.o
######################################################################
Configuring zlib-1.2.3
######################################################################
rm -f libz.*
./configure --prefix=/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/usr
Building static library libz.a version 1.2.3 with /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for errno.h... Yes.
Checking for mmap support... Yes.
######################################################################
Build zlib-1.2.3
######################################################################
Directory: /Users/ap/code/learning/nacl/naclports/src/out/repository/zlib-1.2.3
MAKEFLAGS=EXE=.pexe
make -j4
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o example.o example.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o adler32.o adler32.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o compress.o compress.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o crc32.o crc32.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o gzio.o gzio.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o uncompr.o uncompr.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o deflate.o deflate.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o trees.o trees.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o zutil.o zutil.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o inflate.o inflate.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o infback.o infback.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o inftrees.o inftrees.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o inffast.o inffast.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP   -c -o minigzip.o minigzip.c
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-ar -r libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o 
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/host_x86_64/bin/le32-nacl-ar: creating libz.a
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP -o example.pexe example.o -L. libz.a
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-clang -Dunlink=puts -DUSE_MMAP -o minigzip.pexe minigzip.o -L. libz.a
######################################################################
Finalizing minigzip.pexe
######################################################################
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-finalize minigzip.pexe

real 0m0.309s
user 0m0.256s
sys 0m0.047s
######################################################################
Finalizing example.pexe
######################################################################
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-finalize example.pexe

real 0m0.325s
user 0m0.268s
sys 0m0.051s
######################################################################
Translating minigzip.pexe
######################################################################
translating pexe [arm]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O0 -arch arm minigzip.pexe -o minigzip.arm.nexe

real 0m0.616s
user 0m0.555s
sys 0m0.055s
translating pexe [x86-32]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O0 -arch x86-32 minigzip.pexe -o minigzip.x86-32.nexe

real 0m0.600s
user 0m0.537s
sys 0m0.055s
translating pexe [x86-64]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O0 -arch x86-64 minigzip.pexe -o minigzip.x86-64.nexe

real 0m0.530s
user 0m0.467s
sys 0m0.055s
translating pexe [arm]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O2 -arch arm minigzip.pexe -o minigzip.opt.arm.nexe

real 0m2.255s
user 0m2.144s
sys 0m0.081s
translating pexe [x86-32]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O2 -arch x86-32 minigzip.pexe -o minigzip.opt.x86-32.nexe

real 0m1.863s
user 0m1.785s
sys 0m0.060s
translating pexe [x86-64]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O2 -arch x86-64 minigzip.pexe -o minigzip.opt.x86-64.nexe

real 0m1.855s
user 0m1.776s
sys 0m0.066s
-rwxr-xr-x  1 ap  staff  589584 Dec 10 10:28 ./minigzip.arm.nexe
-rwxr-xr-x  1 ap  staff  414400 Dec 10 10:28 ./minigzip.opt.arm.nexe
-rwxr-xr-x  1 ap  staff  428140 Dec 10 10:28 ./minigzip.opt.x86-32.nexe
-rwxr-xr-x  1 ap  staff  460288 Dec 10 10:28 ./minigzip.opt.x86-64.nexe
-rwxr-xr-x  1 ap  staff  553580 Dec 10 10:28 ./minigzip.x86-32.nexe
-rwxr-xr-x  1 ap  staff  589400 Dec 10 10:28 ./minigzip.x86-64.nexe
-rwxr-xr-x  1 ap  staff  197284 Dec 10 10:28 minigzip.pexe
######################################################################
Translating example.pexe
######################################################################
translating pexe [arm]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O0 -arch arm example.pexe -o example.arm.nexe

real 0m0.823s
user 0m0.732s
sys 0m0.069s
translating pexe [x86-32]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O0 -arch x86-32 example.pexe -o example.x86-32.nexe

real 0m0.602s
user 0m0.539s
sys 0m0.054s
translating pexe [x86-64]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O0 -arch x86-64 example.pexe -o example.x86-64.nexe

real 0m0.556s
user 0m0.495s
sys 0m0.055s
translating pexe [arm]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O2 -arch arm example.pexe -o example.opt.arm.nexe

real 0m2.115s
user 0m2.025s
sys 0m0.070s
translating pexe [x86-32]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O2 -arch x86-32 example.pexe -o example.opt.x86-32.nexe

real 0m1.738s
user 0m1.662s
sys 0m0.064s
translating pexe [x86-64]
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate -O2 -arch x86-64 example.pexe -o example.opt.x86-64.nexe

real 0m2.086s
user 0m2.003s
sys 0m0.065s
-rwxr-xr-x  1 ap  staff  596824 Dec 10 10:28 ./example.arm.nexe
-rwxr-xr-x  1 ap  staff  419256 Dec 10 10:28 ./example.opt.arm.nexe
-rwxr-xr-x  1 ap  staff  434016 Dec 10 10:28 ./example.opt.x86-32.nexe
-rwxr-xr-x  1 ap  staff  466744 Dec 10 10:28 ./example.opt.x86-64.nexe
-rwxr-xr-x  1 ap  staff  562016 Dec 10 10:28 ./example.x86-32.nexe
-rwxr-xr-x  1 ap  staff  599824 Dec 10 10:28 ./example.x86-64.nexe
-rwxr-xr-x  1 ap  staff  589584 Dec 10 10:28 ./minigzip.arm.nexe
-rwxr-xr-x  1 ap  staff  414400 Dec 10 10:28 ./minigzip.opt.arm.nexe
-rwxr-xr-x  1 ap  staff  428140 Dec 10 10:28 ./minigzip.opt.x86-32.nexe
-rwxr-xr-x  1 ap  staff  460288 Dec 10 10:28 ./minigzip.opt.x86-64.nexe
-rwxr-xr-x  1 ap  staff  553580 Dec 10 10:28 ./minigzip.x86-32.nexe
-rwxr-xr-x  1 ap  staff  589400 Dec 10 10:28 ./minigzip.x86-64.nexe
-rwxr-xr-x  1 ap  staff  201512 Dec 10 10:28 example.pexe
######################################################################
Testing zlib-1.2.3
######################################################################
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-finalize minigzip.pexe -o minigzip.pexe_final.pexe

real 0m0.071s
user 0m0.045s
sys 0m0.023s
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate minigzip.pexe_final.pexe -arch x86-32 -o minigzip.x86-32.nexe

real 0m2.089s
user 0m1.949s
sys 0m0.074s
Wrote script /Users/ap/code/learning/nacl/naclports/src/out/repository/zlib-1.2.3/minigzip
DEBUG MODE ENABLED (bypass acl)
DEBUG MODE ENABLED (bypass acl)
hello world
  *** minigzip test OK ***
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-finalize minigzip.pexe -o minigzip.pexe_final.pexe

real 0m0.089s
user 0m0.055s
sys 0m0.030s
/Users/ap/SDKs/nacl/pepper_31/toolchain/mac_pnacl/bin/pnacl-translate minigzip.pexe_final.pexe -arch x86-64 -o minigzip.x86-64.nexe

real 0m2.190s
user 0m2.028s
sys 0m0.081s
Wrote script /Users/ap/code/learning/nacl/naclports/src/out/repository/zlib-1.2.3/minigzip
./minigzip: line 8: /Users/ap/SDKs/nacl/pepper_31/tools/sel_ldr_x86_64: No such file or directory
./minigzip: line 8: /Users/ap/SDKs/nacl/pepper_31/tools/sel_ldr_x86_64: No such file or directory
  *** minigzip test FAILED ***
make: *** [out/sentinels/pnacl/ports/zlib] Error 1

In the meantime, I'm going to try building using the newlib toolchain (since the opencv naclport has successfully installed there). :)

On Tuesday, December 10, 2013 9:34:41 AM UTC-5, Adam Pash wrote:
Ahhh, okay, that makes sense. Thanks Sam, will be back at it again this morning.  

I know that PNaCl seems like it's the future of NaCl, yeah? Is there any performance hit between PNaCl and one of the other NaCl toolchains? (Other than translation time)

On Monday, December 9, 2013, Sam Clegg wrote:
You seem to be building with the PNaCl toolchain now, so you need to
build opencv for PNaCl too:

(naclports/src) $ NACL_ARCH=pnacl make opencv

Also you don't want to be adding the newlib toolchain include path
(each toolchain has its own internal include path which is
automatically included).

cheers,
sam

Adam Pash

unread,
Dec 10, 2013, 11:31:16 AM12/10/13
to native-cli...@googlegroups.com
I'm trying to build using $(NACL_SDK_ROOT)/toolchain/mac_x86_newlib/bin/i686-nacl-g++, and now I'm getting problems linking lppapi_cpp etc. Which... I guess means I'm not understanding how to link things correctly. I've tried hard-coding the link to the libs, but if I understood what you said earlier, I shouldn't have to explicitly link to the build architectures toolchain.

I guess maybe I should just back all the way up and ask:

Let's say I want to use the OpenCV naclport in a project. Here are the steps I've taken so far that I *think* are correct (mentioned above):

    1. I've verified that the SDK tools are installed/working correctly via the Getting Started example (part1 and part2).
    2. I've followed these instructions to sync naclports to my computer.
    1. I installed the opencv naclport by cd'ing into naclports/src, running make opencv, then cd'ed into naclports/src/ports/opencv and run build.sh (with the right path set for NACL_SDK_ROOT)
    1. The build script appears to have installed the OpenCV port into $NACL_SDK_ROOT/toolchain/mac_x86_newlib/i686-nacl/usr/...
      Assuming these steps are correct to this point, what would a simple but proper Makefile look like that could build a trivial app that included some opencv libs?

      Sorry to keep coming back with new and probably obvious questions. I'm determined to wrap my head around this — I'm really interested in experimenting with NaCl!

      Thanks!
      Adam

      Derek Schuff

      unread,
      Dec 10, 2013, 11:57:13 AM12/10/13
      to native-cli...@googlegroups.com
      On Tue, Dec 10, 2013 at 6:34 AM, Adam Pash <adam...@gmail.com> wrote:
      Ahhh, okay, that makes sense. Thanks Sam, will be back at it again this morning.  

      I know that PNaCl seems like it's the future of NaCl, yeah? Is there any performance hit between PNaCl and one of the other NaCl toolchains? (Other than translation time)

      That depends. If you use optlevel: 2 in your PNaCl manifest (the default), the generated code should mostly be faster than the equivalent nacl-gcc code on x86, just because the compiler it's based on is newer and has slightly better optimizers. However some of the security-sandboxing code used by PNaCl is slightly different on x86-64 which could impact performance in some cases, and since the codebases of the compiler are completely different (gcc vs LLVM) there are probably other specific cases where gcc is faster. In general they should be pretty comparable but the only way to be sure is to benchmark. Things are better for nacl-gcc on ARM since it's based on a newer version of gcc.

      Sam Clegg

      unread,
      Dec 10, 2013, 12:57:26 PM12/10/13
      to native-cli...@googlegroups.com
      On Tue, Dec 10, 2013 at 8:31 AM, Adam Pash <adam...@gmail.com> wrote:
      > I'm trying to build using
      > $(NACL_SDK_ROOT)/toolchain/mac_x86_newlib/bin/i686-nacl-g++, and now I'm
      > getting problems linking lppapi_cpp etc. Which... I guess means I'm not
      > understanding how to link things correctly.

      In order to use the additional libraries supplied by the NaCl SDK you
      do need to explicitly point the the compiler and linker at the
      "include" and "lib" folders within the NaCl SDK. Specifically the
      compiler will need something like -I$NACL_SDK_ROOT/include and the
      linker will need something like
      -L$NACL_SDK_ROOT/lib/newlib_$(ARCH)/$CONFIG. The Makefiles for the
      SDK examples (the ones that use common.mk) will do this for you.

      The naclports headers and libraries do *not* require any additional -I
      or -L flags as they install directly into the toolchain folders.

      I've tried hard-coding the link
      > to the libs, but if I understood what you said earlier, I shouldn't have to
      > explicitly link to the build architectures toolchain.
      >
      > I guess maybe I should just back all the way up and ask:
      >
      > Let's say I want to use the OpenCV naclport in a project. Here are the steps
      > I've taken so far that I *think* are correct (mentioned above):
      >
      > I've verified that the SDK tools are installed/working correctly via the
      > Getting Started example (part1 and part2).
      > I've followed these instructions to sync naclports to my computer.
      > I installed the opencv naclport by cd'ing into naclports/src, running make
      > opencv, then cd'ed into naclports/src/ports/opencv and run build.sh (with
      > the right path set for NACL_SDK_ROOT)
      > The build script appears to have installed the OpenCV port into
      > $NACL_SDK_ROOT/toolchain/mac_x86_newlib/i686-nacl/usr/...
      >
      > Assuming these steps are correct to this point, what would a simple but
      > proper Makefile look like that could build a trivial app that included some
      > opencv libs?

      My advice would be to use the common.mk build system, but you can also
      follow the advice above to build your own Makefile.

      Adam Pash

      unread,
      Dec 10, 2013, 2:59:54 PM12/10/13
      to native-cli...@googlegroups.com
      Thanks Sam, appreciate the clarification.

      I'm curious, regarding the OpenCV port: How do I find out how functional the port is? I was able to build the port for x86 (32 and 64), and I was able to link libraries and include files from the opencv port, but if I try using something — for example, a CascadeClassifier or Mat type — it blows up (see log below).

      Is this to be expected, or is this still a problem on my end? Looking at the error, it seems like it might be thrown b/c of some sort of storage attempt (in persistence.cpp) — which I suppose means that persistence.cpp needs to use the pepper api. Is that the case?

        LINK newlib/Release/part2_unstripped_x86_32.nexe
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvGets(CvFileStorage*, char*, int)':
      persistence.cpp:(.text._ZL7icvGetsP13CvFileStoragePci+0x21c): undefined reference to `gzgets'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvXMLSkipSpaces(CvFileStorage*, char*, int)':
      persistence.cpp:(.text._ZL16icvXMLSkipSpacesP13CvFileStoragePci+0x41c): undefined reference to `gzeof'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `T.3326':
      persistence.cpp:(.text.T.3326+0x2bc): undefined reference to `gzeof'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvPuts(CvFileStorage*, char const*)':
      persistence.cpp:(.text._ZL7icvPutsP13CvFileStoragePKc+0x39c): undefined reference to `gzputs'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvClose(CvFileStorage*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
      persistence.cpp:(.text._ZL8icvCloseP13CvFileStoragePSs+0x39c): undefined reference to `gzclose'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `cvOpenFileStorage':
      persistence.cpp:(.text.cvOpenFileStorage+0xc9c): undefined reference to `gzrewind'
      persistence.cpp:(.text.cvOpenFileStorage+0x117c): undefined reference to `gzclose'
      persistence.cpp:(.text.cvOpenFileStorage+0x12bc): undefined reference to `gzopen'
      persistence.cpp:(.text.cvOpenFileStorage+0x223c): undefined reference to `gzclose'
      collect2: ld returned 1 exit status
      make: *** [newlib/Release/part2_unstripped_x86_32.nexe] Error 1


      Sam Clegg

      unread,
      Dec 10, 2013, 4:31:57 PM12/10/13
      to native-cli...@googlegroups.com
      I'm afraid I don't know how complete the opencv port is as I was not
      involved in creating it.

      From your linker errors (based on the names of the undefined symbols)
      it looks like you are missing the zlib library. Make sure that "z" is
      in your list of LIBS and make sure it comes *after* opencv_core.

      cheers,
      sam
      >> > email to native-client-di...@googlegroups.com.
      >> > To post to this group, send email to native-cli...@googlegroups.com.
      >> > Visit this group at
      >> > http://groups.google.com/group/native-client-discuss.
      >> > For more options, visit https://groups.google.com/groups/opt_out.
      >
      > --
      > You received this message because you are subscribed to the Google Groups
      > "Native-Client-Discuss" group.
      > To unsubscribe from this group and stop receiving emails from it, send an
      > email to native-client-di...@googlegroups.com.

      Adam Pash

      unread,
      Dec 10, 2013, 4:53:31 PM12/10/13
      to native-cli...@googlegroups.com
      Thanks Sam. That definitely helped; Mat type is working now, but CascadeClassifier still isn't. 

      I'll email Miguel to see if he's willing to jump in on this thread.
      >> > To post to this group, send email to native-cli...@googlegroups.com.
      >> > Visit this group at
      >> > http://groups.google.com/group/native-client-discuss.
      >> > For more options, visit https://groups.google.com/groups/opt_out.
      >
      > --
      > You received this message because you are subscribed to the Google Groups
      > "Native-Client-Discuss" group.
      > To unsubscribe from this group and stop receiving emails from it, send an

      Miguel Casas-Sanchez

      unread,
      Dec 11, 2013, 4:39:52 AM12/11/13
      to native-cli...@googlegroups.com
      Hi lads,
      couple of things. Apologies for being a bit off... Sven the storm came along! 

      OpenCV itself is a bit trimmed down, from the cmake configuration spitted during the nacl_ports config we have the real list of what's in. This comes from a build a while ago so perhaps some things are slightly different, but the compiled OpenCV modules should stay the same. Note zlib, tiff and jpeg, here it's pointing to (my) local libs, but in the nacl ports they should point to nacl sdk provided ones.

      -- General configuration for OpenCV 2.4.7 =====================================
      --   Version control:               2f5f735
      -- 
      --   Platform:
      --     Host:                        Darwin 13.0.0 i386
      --     Target:                      Linux
      --     CMake:                       2.8.11.2
      --     CMake generator:             Unix Makefiles
      --     CMake build tool:            /usr/bin/make
      --     Configuration:               RELEASE
      -- 
      --   C/C++:
      --     Built as dynamic libs?:      NO
       [blabla]
      --     Linker flags (Release):      
      --     Linker flags (Debug):        
      --     Precompiled headers:         YES
      -- 
      --   OpenCV modules:
      --     To be built:                 core flann imgproc highgui features2d calib3d ml video legacy objdetect photo gpu nonfree contrib stitching superres ts videostab
      --     Disabled:                    world
      --     Disabled by dependency:      -
      --     Unavailable:                 androidcamera java ocl python
      -- 
      --   GUI: 
      --     QT:                          NO
      --     GTK+ 2.x:                    YES (ver 2.24.21)
      --     GThread :                    YES (ver 2.38.0)
      --     GtkGlExt:                    NO
      --     OpenGL support:              NO
      -- 
      --   Media I/O: 
      --     ZLib:                        /opt/local/lib/libz.a (ver 1.2.8)
      --     JPEG:                        NO
      --     PNG:                         /opt/local/lib/libpng.a (ver 1.5.17)
      --     TIFF:                        /opt/local/lib/libtiff.a (ver 42 - 4.0.3)
      --     JPEG 2000:                   NO
      --     OpenEXR:                     NO
      -- 
      --   Video I/O:
      --     DC1394 1.x:                  NO
      --     DC1394 2.x:                  NO
      --     FFMPEG:                      NO
      --       codec:                     NO
      --       format:                    NO
      --       util:                      NO
      --       swscale:                   NO
      --       gentoo-style:              NO
      --     GStreamer:                   NO
      --     OpenNI:                      NO
      --     OpenNI PrimeSensor Modules:  NO
      --     PvAPI:                       NO
      --     GigEVisionSDK:               NO
      --     UniCap:                      NO
      --     UniCap ucil:                 NO
      --     V4L/V4L2:                    NO/NO
      --     XIMEA:                       NO
      --     Xine:                        NO
      -- 
      --   Other third-party libraries:
      --     Use IPP:                     NO
      --     Use Eigen:                   NO
      --     Use TBB:                     NO
      --     Use OpenMP:                  NO
      --     Use GCD                      NO
      --     Use Concurrency              NO
      --     Use C=:                      NO
      --     Use Cuda:                    NO
      --     Use OpenCL:                  NO
      -- 
      --   Python:
      --     Interpreter:                 /usr/bin/python (ver 2.7.5)
      -- 
      --   Java:
      --     ant:                         NO
      --     JNI:                         NO
      --     Java tests:                  NO
      -- 
      --   Documentation:
      --     Build Documentation:         NO
      --     Sphinx:                      NO
      --     PdfLaTeX compiler:           NO
      -- 
      --   Tests and samples:
      --     Tests:                       NO
      --     Performance tests:           NO
      --     C/C++ Examples:              NO
      -- 
      --   Install path:                  /.../mac_x86_glibc/x86_64-nacl/usr
      -- 
      --   cvconfig.h is in:              /.../opencv-2.4.7/build-nacl-x86_64-glibc

      As we see, the modules are almost all in, but forget about retrieving video directly etc - which is logical since you run in a lightweight sandbox anyway.

      Now, your errors seem related to zlib library symbols not found. Again, toying around with the appropriate link line will get you there. They might not be really needed, but well, OpenCV is full of stuff you know... Remember that in a linker command line, order is important, first user then provider of the symbol - otherwise it gets dropped silently by ld

      Next, I'm not sure but easiest first demo might be to load an image from disk using NaCl FileIO and run the face detection on it. Is this what you're on to now?

      Retrieving video frames is not part of the NaCL SDK yet. We're working on it so eventually it'll be public. As a workaround, you can send opaque messages to NaCl containing your images - hacky but will get you to some operational state in the meantime.

      Sense?

      Miguel Casas-Sanchez

      unread,
      Dec 11, 2013, 4:55:08 AM12/11/13
      to native-cli...@googlegroups.com


      On Tuesday, December 10, 2013 10:53:31 PM UTC+1, Adam Pash wrote:

      Adam Pash

      unread,
      Dec 12, 2013, 4:22:50 PM12/12/13
      to native-cli...@googlegroups.com
      Thanks so much, Miguel, that's great to know, and it makes a lot fo sense. My goal is basically to pass an image from JavaScript to NaCl, detect faces, and send back JSON of the face coordinates. 

      Right now, I'm kind of stuck on getting a trivial example to build while including some opencv libs. It seems like you're right, that zlib is my problem, but I'm not sure why it's unable to find it. Here's the Makefile:

      # Copyright (c) 2013 The Chromium Authors. All rights reserved.
      # Use of this source code is governed by a BSD-style license that can be
      # found in the LICENSE file.

      # GNU Makefile based on shared rules provided by the Native Client SDK.
      # See README.Makefiles for more details.

      VALID_TOOLCHAINS := newlib

      NACL_SDK_ROOT ?= $(abspath $(CURDIR)/../..)
      include $(NACL_SDK_ROOT)/tools/common.mk

      TARGET = part2
      LIBS = $(DEPS) ppapi_cpp ppapi \
      z jpeg png tiff \
      opencv_core opencv_imgproc opencv_highgui opencv_objdetect

      CFLAGS = -Wall
      SOURCES = hello_tutorial.cc

      LDFLAGS = -pthread
      CFLAGS:=$(INCLUDES)
      # Build rules generated by macros from common.mk:

      $(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))

      ifeq ($(CONFIG),Release)
      $(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
      $(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
      else
      $(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
      endif

      $(eval $(call NMF_RULE,$(TARGET),))

      And here's the make/error log:

      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/bin/i686-nacl-g++ -o newlib/Release/part2_unstripped_x86_32.nexe newlib/Release/hello_tutorial_x86_32.o -Wl,-as-needed,-rpath -Wl,LIBDIR -Wl,-Map,./newlib/Release/part2_x86_32.map -L/Users/ap/SDKs/nacl/pepper_31/lib/newlib_x86_32/Release -lppapi_cpp -lppapi -lz -ljpeg -lpng -ltiff -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_objdetect 
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvGets(CvFileStorage*, char*, int)':
      persistence.cpp:(.text._ZL7icvGetsP13CvFileStoragePci+0x21c): undefined reference to `gzgets'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvXMLSkipSpaces(CvFileStorage*, char*, int)':
      persistence.cpp:(.text._ZL16icvXMLSkipSpacesP13CvFileStoragePci+0x41c): undefined reference to `gzeof'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `T.3326':
      persistence.cpp:(.text.T.3326+0x2bc): undefined reference to `gzeof'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvPuts(CvFileStorage*, char const*)':
      persistence.cpp:(.text._ZL7icvPutsP13CvFileStoragePKc+0x39c): undefined reference to `gzputs'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `icvClose(CvFileStorage*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
      persistence.cpp:(.text._ZL8icvCloseP13CvFileStoragePSs+0x39c): undefined reference to `gzclose'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_core.a(persistence.cpp.o): In function `cvOpenFileStorage':
      persistence.cpp:(.text.cvOpenFileStorage+0xc9c): undefined reference to `gzrewind'
      persistence.cpp:(.text.cvOpenFileStorage+0x117c): undefined reference to `gzclose'
      persistence.cpp:(.text.cvOpenFileStorage+0x12bc): undefined reference to `gzopen'
      persistence.cpp:(.text.cvOpenFileStorage+0x223c): undefined reference to `gzclose'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(cascadedetect.cpp.o): In function `cv::HOGEvaluator::integralHistogram(cv::Mat const&, std::vector<cv::Mat, std::allocator<cv::Mat> >&, cv::Mat&, int) const':
      cascadedetect.cpp:(.text._ZNK2cv12HOGEvaluator17integralHistogramERKNS_3MatERSt6vectorIS1_SaIS1_EERS1_i+0x4fc): undefined reference to `cv::borderInterpolate(int, int, int)'
      cascadedetect.cpp:(.text._ZNK2cv12HOGEvaluator17integralHistogramERKNS_3MatERSt6vectorIS1_SaIS1_EERS1_i+0x55c): undefined reference to `cv::borderInterpolate(int, int, int)'
      cascadedetect.cpp:(.text._ZNK2cv12HOGEvaluator17integralHistogramERKNS_3MatERSt6vectorIS1_SaIS1_EERS1_i+0xd3c): undefined reference to `cv::integral(cv::_InputArray const&, cv::_OutputArray const&, int)'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(cascadedetect.cpp.o): In function `cv::LBPEvaluator::setImage(cv::Mat const&, cv::Size_<int>)':
      cascadedetect.cpp:(.text._ZN2cv12LBPEvaluator8setImageERKNS_3MatENS_5Size_IiEE+0x21c): undefined reference to `cv::integral(cv::_InputArray const&, cv::_OutputArray const&, int)'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(cascadedetect.cpp.o): In function `cv::HaarEvaluator::setImage(cv::Mat const&, cv::Size_<int>)':
      cascadedetect.cpp:(.text._ZN2cv13HaarEvaluator8setImageERKNS_3MatENS_5Size_IiEE+0x35c): undefined reference to `cv::integral(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int)'
      cascadedetect.cpp:(.text._ZN2cv13HaarEvaluator8setImageERKNS_3MatENS_5Size_IiEE+0x9bc): undefined reference to `cv::integral(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int)'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(cascadedetect.cpp.o): In function `cv::CascadeClassifier::detectMultiScale(cv::Mat const&, std::vector<cv::Rect_<int>, std::allocator<cv::Rect_<int> > >&, std::vector<int, std::allocator<int> >&, std::vector<double, std::allocator<double> >&, double, int, int, cv::Size_<int>, cv::Size_<int>, bool)':
      cascadedetect.cpp:(.text._ZN2cv17CascadeClassifier16detectMultiScaleERKNS_3MatERSt6vectorINS_5Rect_IiEESaIS6_EERS4_IiSaIiEERS4_IdSaIdEEdiiNS_5Size_IiEESH_b+0x57c): undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
      cascadedetect.cpp:(.text._ZN2cv17CascadeClassifier16detectMultiScaleERKNS_3MatERSt6vectorINS_5Rect_IiEESaIS6_EERS4_IiSaIiEERS4_IdSaIdEEdiiNS_5Size_IiEESH_b+0x9bc): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
      /Users/ap/SDKs/nacl/pepper_31/toolchain/mac_x86_newlib/i686-nacl/usr/lib/libopencv_objdetect.a(haar.cpp.o): In function `cvHaarDetectObjectsForROC(void const*, CvHaarClassifierCascade*, CvMemStorage*, std::vector<int, std::allocator<int> >&, std::vector<double, std::allocator<double> >&, double, int, int, CvSize, CvSize, bool)':
      haar.cpp:(.text._Z25cvHaarDetectObjectsForROCPKvP23CvHaarClassifierCascadeP12CvMemStorageRSt6vectorIiSaIiEERS5_IdSaIdEEdii6CvSizeSC_b+0x97c): undefined reference to `cvCvtColor'
      haar.cpp:(.text._Z25cvHaarDetectObjectsForROCPKvP23CvHaarClassifierCascadeP12CvMemStorageRSt6vectorIiSaIiEERS5_IdSaIdEEdii6CvSizeSC_b+0x145c): undefined reference to `cvResize'
      haar.cpp:(.text._Z25cvHaarDetectObjectsForROCPKvP23CvHaarClassifierCascadeP12CvMemStorageRSt6vectorIiSaIiEERS5_IdSaIdEEdii6CvSizeSC_b+0x149c): undefined reference to `cvIntegral'
      haar.cpp:(.text._Z25cvHaarDetectObjectsForROCPKvP23CvHaarClassifierCascadeP12CvMemStorageRSt6vectorIiSaIiEERS5_IdSaIdEEdii6CvSizeSC_b+0x1c3c): undefined reference to `cvIntegral'
      haar.cpp:(.text._Z25cvHaarDetectObjectsForROCPKvP23CvHaarClassifierCascadeP12CvMemStorageRSt6vectorIiSaIiEERS5_IdSaIdEEdii6CvSizeSC_b+0x311c): undefined reference to `cvCanny'
      haar.cpp:(.text._Z25cvHaarDetectObjectsForROCPKvP23CvHaarClassifierCascadeP12CvMemStorageRSt6vectorIiSaIiEERS5_IdSaIdEEdii6CvSizeSC_b+0x315c): undefined reference to `cvIntegral'
      collect2: ld returned 1 exit status
      make: *** [newlib/Release/part2_unstripped_x86_32.nexe] Error 1

      Apologies if this is something I should be able to figure out myself, but... I can't figure out why zlib isn't showing up. Fwiw, I've build zlib from naclports using NACL_ARCH=[x86_64|i386|etc] make zlib (for some reason it blows up if I try to do ./make_all.sh zlib), and each one says its installed, so... I'm not sure why it's unable to find it.

      Any debugging tips/suggestions?

      Sam Clegg

      unread,
      Dec 12, 2013, 5:33:03 PM12/12/13
      to native-cli...@googlegroups.com
      The order of libraries on the link line matters. You should put 'z'
      after 'opencv_core'. There may also be some other re-ordering
      necessary.
      >>>> >> > email to native-client-di...@googlegroups.com.
      >>>> >> > To post to this group, send email to
      >>>> >> > native-cli...@googlegroups.com.
      >>>> >> > Visit this group at
      >>>> >> > http://groups.google.com/group/native-client-discuss.
      >>>> >> > For more options, visit https://groups.google.com/groups/opt_out.
      >>>> >
      >>>> > --
      >>>> > You received this message because you are subscribed to the Google
      >>>> > Groups
      >>>> > "Native-Client-Discuss" group.
      >>>> > To unsubscribe from this group and stop receiving emails from it, send
      >>>> > an
      >>>> > email to native-client-di...@googlegroups.com.
      >>>> > To post to this group, send email to native-cli...@googlegroups.com.
      >>>> > Visit this group at
      >>>> > http://groups.google.com/group/native-client-discuss.
      >>>> > For more options, visit https://groups.google.com/groups/opt_out.
      >
      > --
      > You received this message because you are subscribed to the Google Groups
      > "Native-Client-Discuss" group.
      > To unsubscribe from this group and stop receiving emails from it, send an
      > email to native-client-di...@googlegroups.com.

      Adam Pash

      unread,
      Dec 12, 2013, 5:40:55 PM12/12/13
      to native-cli...@googlegroups.com
      Thanks Sam. Rather than paste in my error logs every time (sorry), is there a way I can go about determining the correct ordering?


      You received this message because you are subscribed to a topic in the Google Groups "Native-Client-Discuss" group.
      To unsubscribe from this topic, visit https://groups.google.com/d/topic/native-client-discuss/zcWAyQioG5A/unsubscribe.
      To unsubscribe from this group and all its topics, send an email to native-client-di...@googlegroups.com.

      Sam Clegg

      unread,
      Dec 12, 2013, 6:46:18 PM12/12/13
      to native-cli...@googlegroups.com
      On Thu, Dec 12, 2013 at 2:40 PM, Adam Pash <adam...@gmail.com> wrote:
      > Thanks Sam. Rather than paste in my error logs every time (sorry), is there
      > a way I can go about determining the correct ordering?
      >

      I don't know of an automatic way to do that. My advice would be to
      look at an opencv example project and see what order it uses when
      building with gcc.

      Evgeniy Stepanov

      unread,
      Dec 13, 2013, 3:31:49 AM12/13/13
      to native-cli...@googlegroups.com
      Of course there is a way. If an error message says that opencv_core
      depends on zlib,

      libopencv_core.a(persistence.cpp.o): In function
      `icvGets(CvFileStorage*, char*, int)':
      ...
      persistence.cpp:(.text._ZL7icvGetsP13CvFileStoragePci+0x21c):
      undefined reference to `gzgets'

      then you need to put -lz after -lopencv_core in the linker command line.
      You can run objdump -t on libraries to figure out what symbols they
      export (to go from "gzgets" to "-lz").

      Miguel Casas-sanchez

      unread,
      Dec 13, 2013, 3:58:20 AM12/13/13
      to native-cli...@googlegroups.com
      FI my linker line is:

      LDFLAGS  += -lopencv_features2d \
                  -lopencv_flann \
                  -lopencv_calib3d \
                  -lopencv_imgproc \
                  -lopencv_core \
                  -lz

      This is for a stitching case, but I think you get the point.

      Morale: Always from the concrete to the generic. Note that, if library A depends on library B which depends on library A again, _you might need to add B twice_, sth like -lA -lB -lA . Yep, that's the way it is, ask binutils folks.


      Miguel Casas-Sanchez | Software Engineer |  mca...@google.com |  +46 (0)70 322 0306
       

      Adam Pash

      unread,
      Dec 13, 2013, 9:44:51 AM12/13/13
      to native-cli...@googlegroups.com
      Thanks so much! The great news is: I was finally able to get it to build! (At least on 64 and 32 bit — having arm and pnacl issues when making some of the dependencies, which I'll try to post about later if that's helpful.)

      Thanks for all the help Sam and Miguel!

      >> >>>> >> > To post to this group, send email to
      >> >>>> >> > native-cli...@googlegroups.com.
      >> >>>> >> > Visit this group at
      >> >>>> >> > http://groups.google.com/group/native-client-discuss.
      >> >>>> >> > For more options, visit
      >> >>>> >> > https://groups.google.com/groups/opt_out.
      >> >>>> >
      >> >>>> > --
      >> >>>> > You received this message because you are subscribed to the Google
      >> >>>> > Groups
      >> >>>> > "Native-Client-Discuss" group.
      >> >>>> > To unsubscribe from this group and stop receiving emails from it,
      >> >>>> > send
      >> >>>> > an

      >> >>>> > To post to this group, send email to
      >> >>>> > native-cli...@googlegroups.com.
      >> >>>> > Visit this group at
      >> >>>> > http://groups.google.com/group/native-client-discuss.
      >> >>>> > For more options, visit https://groups.google.com/groups/opt_out.
      >> >
      >> > --
      >> > You received this message because you are subscribed to the Google
      >> > Groups
      >> > "Native-Client-Discuss" group.
      >> > To unsubscribe from this group and stop receiving emails from it, send
      >> > an

      >> > To post to this group, send email to
      >> > native-cli...@googlegroups.com.
      >> > Visit this group at
      >> > http://groups.google.com/group/native-client-discuss.
      >> > For more options, visit https://groups.google.com/groups/opt_out.
      >>
      >> --
      >> You received this message because you are subscribed to a topic in the
      >> Google Groups "Native-Client-Discuss" group.
      >> To unsubscribe from this topic, visit
      >> https://groups.google.com/d/topic/native-client-discuss/zcWAyQioG5A/unsubscribe.
      >> To unsubscribe from this group and all its topics, send an email to

      >>
      >> To post to this group, send email to
      >> native-cli...@googlegroups.com.
      >> Visit this group at http://groups.google.com/group/native-client-discuss.
      >> For more options, visit https://groups.google.com/groups/opt_out.
      >
      >
      > --
      > You received this message because you are subscribed to the Google Groups
      > "Native-Client-Discuss" group.
      > To unsubscribe from this group and stop receiving emails from it, send an

      > To post to this group, send email to native-cli...@googlegroups.com.
      > Visit this group at http://groups.google.com/group/native-client-discuss.
      > For more options, visit https://groups.google.com/groups/opt_out.

      --
      You received this message because you are subscribed to a topic in the Google Groups "Native-Client-Discuss" group.
      To unsubscribe from this topic, visit https://groups.google.com/d/topic/native-client-discuss/zcWAyQioG5A/unsubscribe.
      To unsubscribe from this group and all its topics, send an email to native-client-discuss+unsub...@googlegroups.com.

      To post to this group, send email to native-cli...@googlegroups.com.
      Visit this group at http://groups.google.com/group/native-client-discuss.
      For more options, visit https://groups.google.com/groups/opt_out.

      Mike Olsen

      unread,
      Feb 15, 2014, 5:14:40 PM2/15/14
      to native-cli...@googlegroups.com
      The information here has been really helpful, I am also able to make the 64bit and 32bit opencv under pepper 32, arm fails when building libpng, but what I would really like to get working is pnacl.

      All the dependencys build fine, but it appears to fail when it tries to generate the make file, here is the output:

      ######################################################################
      Configuring opencv-2.4.7
      ######################################################################
      chdir /cygdrive/c/nacl_sdk/_workspace/naclports/src/out/repository/opencv-2.4.7/build-nacl-pnacl
      cmake .. -DCMAKE_TOOLCHAIN_FILE=/cygdrive/c/nacl_sdk/_workspace/naclports/src/build_tools/XCompile-nacl.cmake -DNACLAR=/cygdrive/c/nacl_sdk/pepper_32/toolchain/win_pnacl/bin/pnacl-ar -DNACLLD=/cygdrive/c/nacl_sdk/pepper_32/toolchain/win_pnacl/bin/pnacl-ld -DNACL_CROSS_PREFIX=pnacl -DNACL_SDK_ROOT=/cygdrive/c/nacl_sdk/pepper_32 -DNACL_TOOLCHAIN_ROOT=/cygdrive/c/nacl_sdk/pepper_32/toolchain/win_pnacl -DCMAKE_INSTALL_PREFIX=/cygdrive/c/nacl_sdk/pepper_32/toolchain/win_pnacl/usr -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=OFF -DWITH_FFMPEG=OFF -DWITH_OPENEXR=OFF -DWITH_CUDA=OFF -DWITH_JASPER=OFF -DWITH_OPENCL=OFF -DWITH_1394=OFF -DWITH_V4L=OFF -DWITH_TIFF=OFF -DBUILD_opencv_apps=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_FAT_JAVA_LIB=OFF
      -- The CXX compiler identification is unknown
      -- The C compiler identification is unknown
      -- Check for working CXX compiler: /cygdrive/c/nacl_sdk/pepper_32/toolchain/win_pnacl/bin/pnacl-clang++
      -- Check for working CXX compiler: /cygdrive/c/nacl_sdk/pepper_32/toolchain/win_pnacl/bin/pnacl-clang++ -- broken
      CMake Error at /usr/share/cmake-2.8.11.2/Modules/CMakeTestCXXCompiler.cmake:54 (message):
        The C++ compiler
        "/cygdrive/c/nacl_sdk/pepper_32/toolchain/win_pnacl/bin/pnacl-clang++" is
        not able to compile a simple test program.

        It fails with the following output:

         Change Dir: /cygdrive/c/nacl_sdk/_workspace/naclports/src/out/repository/opencv-2.4.7/build-nacl-pnacl/CMakeFiles/CMakeTmp



        Run Build Command:/usr/bin/make.exe "cmTryCompileExec1858568177/fast"

        make[1]: Entering directory
        '/cygdrive/c/nacl_sdk/_workspace/naclports/src/out/repository/opencv-2.4.7/build-nacl-pnacl/CMakeFiles/CMakeTmp'


        /usr/bin/make -f CMakeFiles/cmTryCompileExec1858568177.dir/build.make
        CMakeFiles/cmTryCompileExec1858568177.dir/build

        make[2]: Entering directory
        '/cygdrive/c/nacl_sdk/_workspace/naclports/src/out/repository/opencv-2.4.7/build-nacl-pnacl/CMakeFiles/CMakeTmp'


        /usr/bin/cmake.exe -E cmake_progress_report
        /cygdrive/c/nacl_sdk/_workspace/naclports/src/out/repository/opencv-2.4.7/build-nacl-pnacl/CMakeFiles/CMakeTmp/CMakeFiles
        1

        Building CXX object
        CMakeFiles/cmTryCompileExec1858568177.dir/testCXXCompiler.cxx.o

        /cygdrive/c/nacl_sdk/pepper_32/toolchain/win_pnacl/bin/pnacl-clang++
        -I/include -o
        CMakeFiles/cmTryCompileExec1858568177.dir/testCXXCompiler.cxx.o -c
        /cygdrive/c/nacl_sdk/_workspace/naclports/src/out/repository/opencv-2.4.7/build-nacl-pnacl/CMakeFiles/CMakeTmp/testCXXCompiler.cxx


        CMakeFiles/cmTryCompileExec1858568177.dir/build.make:60: recipe for target
        'CMakeFiles/cmTryCompileExec1858568177.dir/testCXXCompiler.cxx.o' failed

        make[2]: Leaving directory
        '/cygdrive/c/nacl_sdk/_workspace/naclports/src/out/repository/opencv-2.4.7/build-nacl-pnacl/CMakeFiles/CMakeTmp'


        Makefile:117: recipe for target 'cmTryCompileExec1858568177/fast' failed

        make[1]: Leaving directory
        '/cygdrive/c/nacl_sdk/_workspace/naclports/src/out/repository/opencv-2.4.7/build-nacl-pnacl/CMakeFiles/CMakeTmp'


        make[2]: ***
        [CMakeFiles/cmTryCompileExec1858568177.dir/testCXXCompiler.cxx.o] Error 127

        make[1]: *** [cmTryCompileExec1858568177/fast] Error 2





        CMake will not be able to correctly generate this project.
      Call Stack (most recent call first):
        CMakeLists.txt:56 (project)


      -- Configuring incomplete, errors occurred!
      Makefile:263: recipe for target 'out/sentinels/pnacl/p

      <td nowrap=
      ...

      Jyoti Sankar Panda

      unread,
      Jul 16, 2014, 7:22:26 AM7/16/14
      to native-cli...@googlegroups.com
      Great to know that, Open CV C++ Code was successfully on to NaCl.
      I'm trying the same thing for a very very simple program that would just show up an window on a opencv window.
      Here is how it looks:

      #include <opencv/cv.h>
      #include <opencv2/highgui/highgui.h>

      using namespace cv;
      using namespace std;

      int main(){

          Mat image;
          image = imread("testimg.jpg");   // Read the file

          if(! image.data )                              // Check for invalid input
          {
              cout <<  "Could not open or find the image" << std::endl ;
              return -1;
          }

          namedWindow( "Display window");// Create a window for display.
          imshow( "Display window", image );                   // Show our image inside it.

          waitKey(0);
          return 0;
      }

      Now when I compile the same, I get these Errors:
        CXX  glibc/Release/showimage_x86_32.o
      showimage.cc:2:37: error: opencv2/highgui/highgui.h: No such file or directory
      showimage.cc: In function ‘int main()’:
      showimage.cc:11: error: ‘imread’ was not declared in this scope
      showimage.cc:20: error: ‘namedWindow’ was not declared in this scope
      showimage.cc:21: error: ‘imshow’ was not declared in this scope
      showimage.cc:23: error: ‘waitKey’ was not declared in this scope
      make: *** [glibc/Release/showimage_x86_32.o] Error 1


      appreciate any help /guide in resolving the issues ...

      ...

      Miguel Casas

      unread,
      Jul 16, 2014, 7:46:59 AM7/16/14
      to native-cli...@googlegroups.com
      Jyoti, 
      OpenCV inside (P)NaCl suffers from sandboxing limitations, in particular no access to files and no creation of Windows per se. 

      The easiest way to plug video frames into NaCl is doing/pretending to be a capture device, see for instance the demo at [1] or [2]. Inside the C++ code (ignoring/removing all OpenGL parts) you can plug in your OpenCV logic.




      --
      You received this message because you are subscribed to a topic in the Google Groups "Native-Client-Discuss" group.
      To unsubscribe from this topic, visit https://groups.google.com/d/topic/native-client-discuss/zcWAyQioG5A/unsubscribe.
      To unsubscribe from this group and all its topics, send an email to native-client-di...@googlegroups.com.

      To post to this group, send email to native-cli...@googlegroups.com.
      Visit this group at http://groups.google.com/group/native-client-discuss.
      For more options, visit https://groups.google.com/d/optout.



      --

      Miguel Casas-Sanchez | Gatopardo del Software |

      Jyoti Sankar Panda

      unread,
      Jul 17, 2014, 2:40:13 AM7/17/14
      to native-cli...@googlegroups.com
      Thanks Miguel !
      I'll try as you suggested.
      I could not locate these examples you have mentioned in the nacl sdk. Do you know, the Makefile that would compile these? or shall I try out copying/modifying any Makefile in nacl sdk examples to get these demos compiled and try?

      Once, I have these demos running, I can replace the OpenGL logic with OpenCV.
      To unsubscribe from this group and all its topics, send an email to native-client-discuss+unsub...@googlegroups.com.

      To post to this group, send email to native-cli...@googlegroups.com.
      Visit this group at http://groups.google.com/group/native-client-dis
      ...

      Miguel Casas

      unread,
      Jul 17, 2014, 7:41:16 AM7/17/14
      to native-cli...@googlegroups.com

      For compiling the examples you need to check out Chromium following instructions and then ninja one of these targets:

      ninja -C out/Debug ppapi_example_vc

      ninja -C out/Debug ppapi_example_media_stream_video



      To unsubscribe from this group and all its topics, send an email to native-client-di...@googlegroups.com.

      To post to this group, send email to native-cli...@googlegroups.com.

      Swaminaathan Iyer

      unread,
      Nov 3, 2014, 12:32:39 PM11/3/14
      to native-cli...@googlegroups.com
      Hi Adam,

      is CascadeClassifier working ?



      On Friday, December 13, 2013 8:14:51 PM UTC+5:30, Adam Pash wrote:
      ...

      Lazar Mladenović

      unread,
      Nov 12, 2014, 11:47:21 AM11/12/14
      to native-cli...@googlegroups.com
      Hi Jyoti,

      Have you made this example working? I'm trying to do the same thing but with no success so far...

      I would like to render video in Chrome browser using NaCl form some other process, so my first step is to load some image from the file system and show it, if I make success with the image I would like to integrate video...

      Any other suggestion would be really helpful for me.

      Thanks,
      Lazar 


      >> >&
      ...

      Michael Eaton

      unread,
      Jun 28, 2015, 8:25:05 AM6/28/15
      to native-cli...@googlegroups.com
      It has been some time since this thread.  I am trying to use openCV in chrome as well.  Could someone post a simple working Makefile, or even better a sample project that is working?  I feel a bit as if I've walked into a ghost town, is there a reason why there seems to be only a small amount of activity on this front?

      Thanks in advance for any assistance.  Feel free to email directly 

      ...

      Sam Clegg

      unread,
      Jun 30, 2015, 10:26:08 AM6/30/15
      to native-cli...@googlegroups.com
      Are you having with using the openCV port in naclports? Is it still
      link order problems like the ones earlier in this thread?

      cheers,
      sam
      > --
      > You received this message because you are subscribed to the Google Groups
      > "Native-Client-Discuss" group.
      > To unsubscribe from this group and stop receiving emails from it, send an
      > email to native-client-di...@googlegroups.com.
      > To post to this group, send email to native-cli...@googlegroups.com.
      > Visit this group at http://groups.google.com/group/native-client-discuss.
      > For more options, visit https://groups.google.com/d/optout.
      Reply all
      Reply to author
      Forward
      0 new messages