I am trying to install OpenCV 3.1 in Mac OS 10.10 Yosemite, however after cmake there was always the following error:
/Users/cwang/Downloads/opencv/modules/core/include/opencv2/core/matx.hpp(503): error: identifier "_Static_assert" is undefined
detected during:
instantiation of "cv::Matx<_Tp, m, n>::Matx(_Tp, _Tp) [with _Tp=float, m=2, n=1]"
OpenCV 3.0 would not produce the error.
Any ideas?
I get around this error by setting CMAKE_CXX_FLAGS=-std=c++11 (check the advanced box if you are using the CMake GUI).
The CV_StaticAssert macro should expand to static_assert for a modern c++ compiler. See the macro for CV_StaticAssert in base.hpp starting at line 275.
Related
I've got a CMake based project that that compiles in MacOS Monterey and produces an application and its dependency dynamic library (dylib file)
When trying to run it macOS bigSur I get the following error :
dyld: Symbol not found: __ZTTNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE
Referenced from: /Applications/myapp.app/Contents/MacOS/../Frameworks/libMylib.dylib
Expected in: /usr/lib/libc++.1.dylib
in /Applications/myapp.app/Contents/MacOS/../Frameworks/libMylib.dylib
Abort trap: 6
even tough I specifically used the following settings when building the library
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum OS X deployment version" FORCE)
Perhaps anybody encountered similar behavior ? the only thing that's works for my is to build the target in BigSur machine.
I tried to build FLTK 1.3.4-2 version on my mac. I followed the instruction, and successfully configure it.
But when I install it, it shows:
Compiling Fl_cocoa.mm...
In file included from Fl_cocoa.mm:55:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:128:
/System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:26:49: error: nullability specifier '_Nullable' cannot be applied to
non-pointer type 'uuid_t' (aka 'unsigned char [16]')
- (instancetype)initWithUUIDBytes:(const uuid_t _Nullable)bytes;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:29:30: error: nullability specifier '_Nonnull' cannot be applied to
non-pointer type 'uuid_t' (aka 'unsigned char [16]')
- (void)getUUIDBytes:(uuid_t _Nonnull)uuid;
^
2 errors generated.
make[1]: *** [Fl_cocoa.o] Error 1
make: *** [install] Error 1
Does anyone know how to solve this problem?
It seems you build system is a bit of mix'n'match and through that you have found a compiler bug.
The error message indicates that the compiler is not recognising that an array type (uuid_t) when used as a function/method parameter type becomes a pointer type (as C-style arrays are passed by reference not by value) before it checks the validity of _Nullable/_Nonnull – so it throws the error as _Nullable/_Nonnull are not applicable to array types.
However not only isn't this your code, it is system code which is causing the error, which is surprising. Which is where the mix'n'match comes in...
Prior to the macOS10.13 SDK the two methods causing the error, initWithUUIDBytes: and getUUIDBytes:, were not annotated with nullability attributes. By default Xcode 8.1 uses the macOS10.12 SDK and your code should compile with that arrangement – the included header, NSUUID.h, will not contain the nullability attributes.
If you wrote your own code with array typed parameters and specified nullability then Xcode 8.1's compiler would produce an error – the bug is in (at least) that compiler. But this isn't your code...
Xcode 9.4.1 (lastest 9) by default uses macOS10.13SDK and again your code would compiler – the included header will contain the nullability attributes and Xcode 9.4.1's compiler will not produce an error as the bug has been fixed.
So at best guess either you are using Xcode 8.1 but with the macOS10.13+ SDK intentionally installed, or you've managed to install the macOS10.13+ SDK headers and you are using a version of gcc which has the bug, or you've got multiple versions of Xcode installed and the command line tools are not for Xcode 8.1 (How to switch between multiple Command Line Tools installations in Mac OS X (without installing XCode) may help), or some other scenario where you've got mismatched compilers and installed SDKs – nobody else but you can know what is actually installed on your system; the header file path is a system location so the header causing the issue isn't a copy in the FLTK source folder.
HTH
[BTW your gcc comes from 2007, if you are building with it you should probably update to something newer.]
I am trying to install vmware 8 on kubuntu bionic with gcc-7.3. The installation process went well until the message "gcc is not found". gcc is there but I guess vmware 8 is too old and does not recognize gcc version 7.3.
I have tried to manually compiled the modules (vmmon and stuff) but an error came out. An example is shown below.
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c: At top level:
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:175:19: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.fault = LinuxDriverFault
^~~~~~~~~~~~~~~~
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:175:19: note: (near initialization for ‘vmuser_mops.fault’)
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c: In function ‘init_module’:
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:346:4: error: implicit declaration of function ‘init_timer’; did you mean ‘init_timers’? [-Werror=implicit-function-declaration]
init_timer(&linuxState.pollTimer);
^~~~~~~~~~
init_timers
Is there a workaround?
Many thanks
Using:
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
there are huge numbers of errors introduced in the standard library by a really stupid coding error: an example is here:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono:281:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio:256:81: fatal error:
unknown class name 'false_type'; did you mean '::std::false_type'?
template struct __is_ratio : false_type {};
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:278:38: note:
'::std::false_type' declared here
typedef _LIBCPP_BOOL_CONSTANT(false) false_type;
^
The compiler diagnostic is correct, it should read ::std::false_type. I fixed that but then found the same error is repeated over and over again all over the library. The library worked until I decided to use chrono. The bug, however, is not just in chrono.
Does anyone know if this has been fixed?
I'm trying to get OpenCV built on OSX (Yosemite), following this guide: http://blogs.wcode.org/2014/10/howto-install-build-and-use-opencv-macosx-10-10/
Got the static libs built fine but when building the shared libs I get errors, including the following:
/Users/chrismash/Development/OSX/WireframeUpscaler/WireframeUpscaler/ThirdParty/opencv-3.0.0/modules/core/src/ocl.cpp:2700:49:
error:
use of undeclared identifier 'clEnqueueSVMUnmap'; did you mean
'svm::SVMFunctions::fn_clEnqueueSVMUnmap'? ...= clEnqueueSVMUnmap;
^~~~~~~~~~~~~~~~~
svm::SVMFunctions::fn_clEnqueueSVMUnmap
/Users/chrismash/Development/OSX/WireframeUpscaler/WireframeUpscaler/ThirdParty/opencv-3.0.0/modules/core/src/ocl.cpp:2700:49:
error:
invalid use of non-static data member 'fn_clEnqueueSVMUnmap'
svmFunctions.fn_clEnqueueSVMUnmap = clEnqueueSVMUnmap;
Any ideas where I might be going wrong...?
As #jprice pointed out it seems I somehow got the WITH_OPENCL_SVM option enabled in CMake. Because OS X doesn't support OpenCL 2.0 yet it should be unticked.