Android native build error. clang++: error: unknown argument: '-fconcepts-ts' - c++

I am using code where auto is used for function. It compiles well on gcc compiler on linux machine. When I using the same function in android native, it is throwing the error
clang++: error: unknown argument: '-fconcepts-ts'
-fconcepts-ts is optional on linux machine as without it , we only get a warning.
But for android native build, I am not understanding where to fix this.
I updated build.gradle to reflect the cppflags for c++17
cppFlags '-std=c++17'
However, it is not recognizing the -fconcepts-ts flag at all.
Please help.

Related

(Clang Error) compilation error: ld: library not found for -lcrt0.o. Any ideas?

The full terminal output is as follows:
>g++ -std=c++98 -static mainP1.o -o mainP1
>
>ld: library not found for -lcrt0.o
>
>clang: error: linker command failed with exit code 1 (use -v to see invocation)
>
>make: *** [mainP1] Error 1
I'm on a 2020 MacBook Pro with an intel CPU using Visual Studio Code. When I write basic OOP programs in C++ it compiles fine without any clang errors. However, when working with big OOP programs with multiple classes inheriting from a base class I would get this error.
I tried searching online for solutions, but no solution or explanation was found. I double-checked my makefile to ensure I was not linking classes incorrectly.
I thought maybe I should just dual-boot with UBUNTU Linux to avoid this weird XCODE issue I was encountering with clang, but that was also a fruitless endeavor.
The problem was my compiler path in Visual Studio Code.
I changed it to clang++, and now all my code compiles and executes without any problems.
How I changed it:
CMD + SHIFT + P
Typed in: C/C++: Edit Configurations (UI)
Made sure that "Mac" was selected under configuration name.
Changed Compiler Path to: /usr/bin/clang++

How can I fix the compling error on oneAPI code

I am trying oneAPI from Intel office website: https://www.intel.com/content/www/us/en/develop/documentation/oneapi-programming-guide/top/programming-interface/example-compilation.html
I have completed step 1 “oneAPI Development Environment Setup” and verified it successfully.
In step 2, when I run dpcpp -I${MKLROOT}/include -c axpy.cpp -o axpy.o, it reports several errors:
oneapi/compiler/2022.0.1/linux/bin-llvm/../include/sycl/CL/sycl/bit_cast.hpp:33:22: error: no member named 'is_trivially_copyable' in namespace 'std'
oneapi/compiler/2022.0.1/linux/bin-llvm/../include/sycl/CL/sycl/sycl_span.hpp:164:42: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'detail::remove_cv_t'
oneapi/compiler/2022.0.1/linux/bin-llvm/../include/sycl/CL/sycl/sycl_span.hpp:187:39: error: no template named 'is_array_v' in namespace 'std'; did you mean 'is_array'
I guess there is some compatibility issue, but I have no idea how to fix.
Thanks!
The issue might be with the version of GCC that you have in your system, please check in the system requirements for DPCPP compiler from the below link, intel.com/content/www/us/en/developer/articles/… "Supported minimum versions of distributed libraries that the compilers are built on: GCC - 7.3.0, BINUTILS- 2.30, GLIBC-2.27"

Xcode9 seems doesn't support 3rd llvm compiler?

Replace the default Apple-LLVM with the LLVM 5.0 downloaded from llvm.org.
and compiling, xcode thrown an error:
clang-5.0: error: cannot specify -o when generating multiple output files
Xcode8 is OK.
Thanks.
This is not a Clang 5.0-only issue. I am having the same issue with a custom Clang 3.9.
Xcode 9 has introduced a custom argument that a normal Clang does not support:
The -index-store-path argument does not exist in Clang 5.0 and it gets discarded without any error message. The problem is that its argument, a folder, is not discarded, and Clang considers it as a source file. This leads to the following errors:
cannot specify -o when generating multiple output files (this happens if a -o argument is passed)
error reading '<PATH>' (this can be observed when running the "normalized" version of the clang command, generated via the -### flag)
Source: Facebook/infer: Remove unsupported index-store-path argument from clang commands.
In my custom toolchain based on Clang/CMake/Xcode I use a wrapper around clang in which I just cut off this argument and the folder passed to it and everything works fine.

Mingw32 errors when building OpenCV 3.2.0 on Windows 7

I'm trying to build OpenCV 3.2.0 vc14 from its sources with MinGW 5.3.0 32 bit in order to use its functionality from Qt 5.8. My platform is Windows 7 64 bit.
The main instruction I follow is here, on Qt's wiki. On several steps, I encounter errors for which I haven't found solutions yet. As I am a newbie, I apologize for my helplessness and will appriciate any suggestions.
Error 1. On the stage of generating build files.
In cmake-gui (cmake-3.2.1-win32-x86), I precisely follow the steps specified in the Qt wiki article mentioned above. However, during the final generation, the following CMake error occurs at the end:
CMake Error in modules/highgui/CMakeLists.txt:
No known features for CXX compiler
"GNU"
version 5.3.0.
Generating done
I wonder how it affects the project files and if it causes the next errors.
Error 2. When trying to build OpenCV
The build process is interrupted midway, logging the following:
In file included from C:/Qt/Tools/mingw530_32/i686-w64-
mingw32/include/c++/type_
traits:35:0,
from C:/Qt/5.8/mingw53_32/include/QtCore/qglobal.h:45,
from C:/Qt/5.8/mingw53_32/include/QtCore/QtCore:4,
from C:/Qt/5.8/mingw53_32/include/QtOpenGL/QtOpenGLDepends:3,
from C:/Qt/5.8/mingw53_32/include/QtOpenGL/QtOpenGL:3,
from C:/opencv/sources/modules/highgui/src/window_QT.h:46,
from C:\opencv\sources\modules\highgui\src\window_QT.cpp:47:
C:/Qt/Tools/mingw530_32/i686-w64-
mingw32/include/c++/bits/c++0x_warning.h:32:2:
error: #error This file requires compiler and library support for the ISO
C++ 2011 standard. This support is currently experimental, and must be
enabled with the -std=c++11 or -std=gnu++11 compiler options.
(...)
C:/Qt/5.8/mingw53_32/include/QtCore/qcompilerdetection.h:562:6: error:
#error Qt requires a C++11 compiler and yours does not seem to be that.
(...)
^
C:/Qt/5.8/mingw53_32/include/QtCore/qtypeinfo.h:62:40: error: expected
primary-expression before '>' token isIntegral = std::is_integral<T>::value,
^
C:/Qt/5.8/mingw53_32/include/QtCore/qtypeinfo.h:62:41: error: '::value' has
not been declared isIntegral = std::is_integral<T>::value,
NOTE: I also had sprintf() family security error. So I followed Alex's suggestion to add add_definitions(-DSTRSAFE_NO_DEPRECATE) to the beginning of CMakeLists.txt to suppress the error.
Thank you for your time.

Compile with Intel 12.1.3 using gcc4.7 std library

I'm having the same problem described in this post except I'm using Intel version 12.1.3. (g++'s header <functional> is protected with #ifdef __GXX_EXPERIMENTAL_CXX0X__ which is not defined when icpc is used.)
Instead of using boost::functional, I wanted to install gcc4.7 and use it's std libraries.
In Ubuntu 11.10 I have gcc4.6.1 but I also installed gcc4.7 from the gcc-snapshot package.
Intel has the options -gcc-name, -gxx-name, and -cxxlib.
So originally I compiled with:
-std=c++0x -gcc-name=/usr/lib/gcc-snapshot/bin/gcc -gxx-name=/usr/lib/gcc-snapshot/bin/g++ -cxxlib=/usr/lib/gcc-snapshot/
but I get the error:
icpc: error #10282: file
'/usr/lib/gcc-snapshot/bin/usr/lib/gcc-snapshot/bin/g++' not found,
generated based on '-cxxlib=/usr/lib/gcc-snapshot/'
So then I compiled with:
-std=c++0x -gcc-name=./gcc -gxx-name=./g++ -cxxlib=/usr/lib/gcc-snapshot/.
But I still get the warnings and errors:
Warning #2928: the __GXX_EXPERIMENTAL_CXX0X__ macro is disabled when using GNU version 4.6 with the c++0x option
error: namespace "std" has no member "function"
The warning clearly says it's still using version 4.6. Does anybody know how to get Intel to use the correct libraries?
I've found that if you compile with gcc (or g++) with flags -v -Q you get a list of flags and defines. It might help you see what gcc does so maybe you can use the same -D/-U in icpc. also g++ -E will preprocess without compiling: you can get useful path information from that.