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?
Related
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
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.
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.
I am compiling a project on multiple platforms with the c++0x flag. The only platform I am having trouble on is Mac. It seems to get upset over things that other compilers let slide. I am using Mac 10.8, Qt 5.3.2 with the following version of clang.
clang -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
This is the error it is generating.
In file included from src/qt/bitcoin.cpp:5:
In file included from ../../Qt5.3.2/5.3/clang_64/lib/QtWidgets.framework/Versions/5/Headers/QApplication:1:
In file included from ../../Qt5.3.2/5.3/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qapplication.h:45:
In file included from /Users/user/Qt5.3.2/5.3/clang_64/lib/QtCore.framework/Headers/qcoreapplication.h:45:
In file included from /Users/user/Qt5.3.2/5.3/clang_64/lib/QtCore.framework/Headers/qglobal.h:78:
In file included from /Users/user/Qt5.3.2/5.3/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:846:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/utility:254:9: error: field has incomplete type 'CScript'
_T2 second;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:1994:27: note: in instantiation of template class 'std::__1::pair<const CScriptID, CScript>'
requested here
decltype(__is_constructible_test(declval<_Tp>(), declval<_Args>()...))
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2043:14: note: in instantiation of template class 'std::__1::__is_constructible<false,
std::__1::allocator<std::__1::pair<const CScriptID, CScript> >>' requested here
: public __is_constructible<is_scalar<_Tp>::value || is_reference<_Tp>::value,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2069:14: note: in instantiation of template class
'std::__1::__is_constructible_void_check<false, std::__1::allocator<std::__1::pair<const CScriptID, CScript> >>' requested here
: public __is_constructible_void_check<__contains_void<_Tp, _Args...>::value
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2549:34: note: in instantiation of template class
'std::__1::is_constructible<std::__1::allocator<std::__1::pair<const CScriptID, CScript> >>' requested here
: __is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, _Tp, _Args...>
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2671:14: note: in instantiation of template class
'std::__1::is_nothrow_constructible<std::__1::allocator<std::__1::pair<const CScriptID, CScript> >>' requested here
: public is_nothrow_constructible<_Tp>
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/map:840:13: note: in instantiation of template class
'std::__1::is_nothrow_default_constructible<std::__1::allocator<std::__1::pair<const CScriptID, CScript> > >' requested here
is_nothrow_default_constructible<allocator_type>::value &&
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config:332:34: note: expanded from macro '_NOEXCEPT_'
# define _NOEXCEPT_(x) noexcept(x)
^
src/keystore.h:43:7: note: in instantiation of exception specification for 'map' requested here
class CBasicKeyStore : public CKeyStore
^
src/serialize.h:28:7: note: forward declaration of 'CScript'
class CScript;
^
src/keystore.h:116:5: note: implicit default constructor for 'CBasicKeyStore' first required here
CCryptoKeyStore() : fUseCrypto(false)
^
I am having the same problem, it seems to be related with clang and c++11.
My scenario:
- Mac osx 10.10.1 yosemite
- Xcode 6.1 with Command Line tools 6.1
- Gnu make 3.81
- gcc -v:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
No homebrew, no macports, just some dependencies compiled by hand.
I am trying to compile for x86_64.
Any clue?
My idea could be recompile every dependency with gcc instead of clang, but I still had not time to test it, maybe it works for you ;)