berak / heartbeat

optical pulse detection
6 stars 4 forks source link

can't compile on mac #1

Open atv2016 opened 8 years ago

atv2016 commented 8 years ago

Hi Berak, I tried compiling this on Mac but i get the following (to strict c++ compiler?)

50%] Building CXX object CMakeFiles/heartbeat.dir/heartbeat.cpp.o PreProcess/heartbeat.cpp:11:70: error: declaration of 'size_t' shadows template parameter template <typename Vec, typename Operator, typename size_t, typename size_t> ^ PreProcess/heartbeat.cpp:11:53: note: template parameter is declared here template <typename Vec, typename Operator, typename size_t, typename size_t> ^ PreProcess/heartbeat.cpp:12:35: error: reference to 'size_t' is ambiguous void foreach(Vec &v, Operator &op,size_t off,size_t len) { ^ PreProcess/heartbeat.cpp:11:70: note: candidate found by name lookup is 'size_t' template <typename Vec, typename Operator, typename size_t, typename size_t> ^ PreProcess/heartbeat.cpp:11:53: note: candidate found by name lookup is 'size_t' template <typename Vec, typename Operator, typename size_t, typename size_t> ^ PreProcess/heartbeat.cpp:12:46: error: reference to 'size_t' is ambiguous void foreach(Vec &v, Operator &op,size_t off,size_t len) { ^ PreProcess/heartbeat.cpp:11:70: note: candidate found by name lookup is 'size_t' template <typename Vec, typename Operator, typename size_t, typename size_t> ^ PreProcess/heartbeat.cpp:11:53: note: candidate found by name lookup is 'size_t' template <typename Vec, typename Operator, typename size_t, typename size_t> ^ PreProcess/heartbeat.cpp:13:10: error: reference to 'size_t' is ambiguous for (size_t i=off; i<len; ++i) { ^ PreProcess/heartbeat.cpp:11:70: note: candidate found by name lookup is 'size_t' template <typename Vec, typename Operator, typename size_t, typename size_t> ^ PreProcess/heartbeat.cpp:11:53: note: candidate found by name lookup is 'size_t' template <typename Vec, typename Operator, typename size_t, typename size_t> ^ PreProcess/heartbeat.cpp:228:29: error: reference to 'Hamming' is ambiguous foreach(din,Hamming(din.size())); ^ PreProcess/heartbeat.cpp:57:8: note: candidate found by name lookup is 'Hamming' struct Hamming ^ /usr/local/include/opencv2/core/base.hpp:429:19: note: candidate found by name lookup is 'cv::Hamming' struct CV_EXPORTS Hamming ^ PreProcess/heartbeat.cpp:228:17: error: no matching function for call to 'foreach' foreach(din,Hamming(din.size())); ^~~ PreProcess/heartbeat.cpp:19:6: note: candidate function [with Vec = std::1::vector<float, std::1::allocator >, Operator = Hamming] not viable: expects an l-value for 2nd argument void foreach(Vec &v, Operator &op) { ^ PreProcess/heartbeat.cpp:12:6: note: candidate function template not viable: requires 4 arguments, but 2 were provided void foreach(Vec &v, Operator &op,size_t off,size_t len) { ^ PreProcess/heartbeat.cpp:249:30: error: reference to 'Hamming' is ambiguous foreach(idft,Hamming(idft.size())); ^ PreProcess/heartbeat.cpp:57:8: note: candidate found by name lookup is 'Hamming' struct Hamming ^ /usr/local/include/opencv2/core/base.hpp:429:19: note: candidate found by name lookup is 'cv::Hamming' struct CV_EXPORTS Hamming ^ PreProcess/heartbeat.cpp:249:17: error: no matching function for call to 'foreach' foreach(idft,Hamming(idft.size())); ^~~ PreProcess/heartbeat.cpp:19:6: note: candidate function [with Vec = std::1::vector<float, std::1::allocator >, Operator = Hamming] not viable: expects an l-value for 2nd argument void foreach(Vec &v, Operator &op) { ^ PreProcess/heartbeat.cpp:12:6: note: candidate function template not viable: requires 4 arguments, but 2 were provided void foreach(Vec &v, Operator &op,size_t off,size_t len) { ^ PreProcess/heartbeat.cpp:20:12: error: no matching function for call to 'foreach' return foreach(v,op,0,v.size()); ^~~ PreProcess/heartbeat.cpp:219:13: note: in instantiation of function template specialization 'foreach<std::1::vector<float, std::1::allocator >, MinMaxId>' requested here foreach(ring.elm,mm); ^ PreProcess/heartbeat.cpp:12:6: note: candidate template ignored: deduced conflicting types for parameter 'size_t' ('int' vs. 'unsigned long') void foreach(Vec &v, Operator &op,size_t off,size_t len) { ^ PreProcess/heartbeat.cpp:19:6: note: candidate function template not viable: requires 2 arguments, but 4 were provided void foreach(Vec &v, Operator &op) { ^ PreProcess/heartbeat.cpp:20:12: error: no matching function for call to 'foreach' return foreach(v,op,0,v.size()); ^~~ PreProcess/heartbeat.cpp:233:17: note: in instantiation of function template specialization 'foreach<std::1::vector<float, std::1::allocator >, void (int, float &)>' requested here foreach(dout,Abs); ^ PreProcess/heartbeat.cpp:12:6: note: candidate template ignored: deduced conflicting types for parameter 'size_t' ('int' vs. 'unsigned long') void foreach(Vec &v, Operator &op,size_t off,size_t len) { ^ PreProcess/heartbeat.cpp:19:6: note: candidate function template not viable: requires 2 arguments, but 4 were provided void foreach(Vec &v, Operator &op) { ^ 10 errors generated. make[2]: * [CMakeFiles/heartbeat.dir/heartbeat.cpp.o] Error 1 make[1]: * [CMakeFiles/heartbeat.dir/all] Error 2 make: *\ [all] Error 2

berak commented 8 years ago

ah, - guilty !. (never bothered to try anything apart from VS for this)

atv2016 commented 8 years ago

No worries I was looking at some code like pulse and eulerian video magnification and such before and this looked interesting.

Just let me know if you need it tested on Mac

Sent from my iPhone

On 21 Sep 2016, at 06:12, berak notifications@github.com<mailto:notifications@github.com> wrote:

ah, - guilty !. (never bothered to try anything apart from VS for this)

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/berak/heartbeat/issues/1#issuecomment-248513368, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQIi02UrMIlE9jz8yfQ0lKfzDPttQ8Agks5qsLyggaJpZM4KCG5o.

berak commented 8 years ago

tbh, i somehow discarded this project (got more noise than signal, so i'm probably doing something wrong there)

made a quick check with g++ (mingw64), and got the same Hamming duplication (that should be simply renamed). but none of the other errs (clang, i guess).

apart from that - i found out later (trying on android, hehe), that it's far easier to just put your thumb onto the camera (and let the light shine through), than the ugly mess i did there with 2 "windows" and where you have to sit absolutely still for 15 seconds.

atv2016 commented 8 years ago

Yes i always thought that terribly unreliable. What user is possibly going to sit still for 15 seconds. Thumb on camera is a good idea. Or maybe if they make pressure sensitive mice, one could take advantage of that.

I'll try and compile with g++ as clang is very picky.

It seems to take the 2 foreach call templates as one with clang and incorrectly interpreting the amount of arguments needed.