Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I am not able to build my opencv project in eclipse

OS : macOs High Sierra

Using OpenCV in Eclipse

I have included the libraries and include files of Opencv in project properties. Yet while building Following error shows

12:22:05 * Incremental Build of configuration Release for project SampleImage *

make all

Building file: ../Main.cpp

Invoking: GCC C++ Compiler

g++ -I/usr/local/Cellar/opencv/3.4.1_2/include -I/Library/Developer/CommandLineTools/usr/include -I/Library/Developer/CommandLineTools/usr/include/c++/v1 -O3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"Main.d" -MT"Main.o" -o "Main.o" "../Main.cpp"

In file included from ../Main.cpp:1:

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:111:82: error: use of undeclared identifier 'labs'; did you mean 'abs'?

inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:111:44: note: 'abs' declared here inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:113:81: error: use of undeclared identifier 'llabs' inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:116:35: error: unknown type name 'ldiv_t' inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:116:95: error: use of undeclared identifier 'ldiv'; did you mean 'div'?

inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:116:42: note: 'div' declared here inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:118:34: error: unknown type name 'lldiv_t' inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:118:94: error: use of undeclared identifier 'lldiv' inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);} ^

In file included from ../Main.cpp:3:

/Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:733:41: error: no member named 'fabsf' in the global namespace

abs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);} ~~^

/Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:737:42: error: no member named 'fabs' in the global namespace; did you mean 'abs'? abs(double __lcpp_x) _NOEXCEPT {return ::fabs(__lcpp_x);} ~~^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:111:44: note: 'abs' declared here inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^

Other C++ program is working perfectly in Eclipse and I have checked Xcode also and i was able to develop application in xcode that too opencv application

Can any one help me in identifying the issue ??

click to hide/show revision 2
retagged

updated 2018-05-03 02:05:48 -0600

berak gravatar image

I am not able to build my opencv project in eclipse

OS : macOs High Sierra

Using OpenCV in Eclipse

I have included the libraries and include files of Opencv in project properties. Yet while building Following error shows

12:22:05 * Incremental Build of configuration Release for project SampleImage *

make all

Building file: ../Main.cpp

Invoking: GCC C++ Compiler

g++ -I/usr/local/Cellar/opencv/3.4.1_2/include -I/Library/Developer/CommandLineTools/usr/include -I/Library/Developer/CommandLineTools/usr/include/c++/v1 -O3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"Main.d" -MT"Main.o" -o "Main.o" "../Main.cpp"

In file included from ../Main.cpp:1:

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:111:82: error: use of undeclared identifier 'labs'; did you mean 'abs'?

inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:111:44: note: 'abs' declared here inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:113:81: error: use of undeclared identifier 'llabs' inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:116:35: error: unknown type name 'ldiv_t' inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:116:95: error: use of undeclared identifier 'ldiv'; did you mean 'div'?

inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:116:42: note: 'div' declared here inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:118:34: error: unknown type name 'lldiv_t' inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);} ^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:118:94: error: use of undeclared identifier 'lldiv' inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);} ^

In file included from ../Main.cpp:3:

/Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:733:41: error: no member named 'fabsf' in the global namespace

abs(float __lcpp_x) _NOEXCEPT {return ::fabsf(__lcpp_x);} ~~^

/Library/Developer/CommandLineTools/usr/include/c++/v1/math.h:737:42: error: no member named 'fabs' in the global namespace; did you mean 'abs'? abs(double __lcpp_x) _NOEXCEPT {return ::fabs(__lcpp_x);} ~~^

/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:111:44: note: 'abs' declared here inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^

Other C++ program is working perfectly in Eclipse and I have checked Xcode also and i was able to develop application in xcode that too opencv application

Can any one help me in identifying the issue ??