Building OpenCV with Clang 5 in Windows - c++

I'm trying to build OpenCV in Windows 7 with Clang 5.0.0 but Cmake does not recognize the option and, therefore, there is no compilation available.
The system contains Clang 5.0.0, MSVC 2013 Express and Cmake 3.10.0.
Googling the solution does not show any valid results.
There is any way to generate the OpenCV dll/lib with Clang (and LLVM) capabilites/dependencies?
If there is a workaround evading MSVC, I accept it, too.
Thanks in advance.

Related

How can I use different Xcode versions for different branches (or latest Xcode with different Clang versions)?

We compile different branches of our project with different versions of Xcode, because it has different versions of the c++ compiler "clang" built-in. And a new compiler not only means new features, but unfortunately also new compiler bugs (hence new workarounds). So we want to keep the compiler once we branched a stable version of our project, but always use the latest compiler for the trunk.
Installing several Xcode versions is easy: We just add the Version number to the name and so we get:
/Applications/Xcode9
/Applications/Xcode10
/Applications/Xcode11
For the integration server and other scripts the required version can easily be picked and started with
xcode-select -s /Applications/Xcode10.app
xcodebuild -project myproj.xcodeproj build
But for working on the different branches with Xcode as graphical IDE this proves to be quite a problem:
Unlike Visual Studio Solutions (.sln and .vcxproj), Xcode Projects (.xcproj) don't support the specification of an IDE version they open in.
Different versions of Xcode don't play well together and seem to overwrite each others settings and caches (e.g. which projects/windows that were open, and even build status).
My last hope of solving this is to always use the latest Xcode IDE, but let it use an earlier compiler version.
There seems to be a project setting under Build Options for this, called Compiler for C/C++/Objective-C (GCC_VERSION when set via .xcconfig) with the standard value Default Compiler (Apple Clang) (com.apple.compilers.llvm.clang.1_0).
However, I was not able to find another valid value that I could use there. So far, I have tried clang version number and path to the clang executable (e.g. /Applications/Xcode10.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang). Xcode always says Unsupported Compiler.
So what is the correct way to specify another compiler version in Xcode? Or do you know another approach to solve the original problem?
I found a way to use an older clang version in latest IDE. This example works for using the Apple LLVM version 10.0.0 (clang-1000.11.45.2) in the Xcode 11.3:
In the .xcconfig file (Menu->File->New->File, "Configuration Settings File"), the compiler paths can be set explicitly with
CC = /Applications/Xcode10.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
CPLUSPLUS = /Applications/Xcode10.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
But this is not enough: The system header files of a newer Xcode installation are sometimes incompatible with the old compiler. We need to set the roots for these files accordingly
OTHER_CFLAGS = -isysroot /Applications/Xcode10.app/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

Can I safely upgrade to clang 6.0.0 for use with Xcode 9.0?

I can build clang 6.0.0 following the instructions on the clang website, but I don't know where to safely install it or how to configure Xcode to use it.
I'm on macOS High Sierra.
Any help is appreciated.
This question was answered by: How do I make Xcode use an alternative version of clang?
The answer from MrMobster was perfect for me. The following post was also helpful:
Compilation error when using Xcode 9.0 with clang (cannot specify -o when generating multiple output files)

QT enable cross-compiling using MinGW (precompiled)

Good day all
I have been searching for a method of cross-compiling for QT-Creator in Linux for sometime now, and I have been having alot of trouble with it.
Background info
please note: I am on a Linux machine, and would like to cross compile Windows Apps
My system:
Ubuntu Gnome 16.10
QT Creator 4.0.2 (based on QT 5.7)
I have came across a few SO links, a few blogs with broken instructions, etc and one seeming helpful but dependencies could not be found.
I have also attempted another compiler MXE and cloned and attempted to build the MXE compiler from the GIT repo, which failed (no solution for the build error - VTK build error)
I decided to download precompiled MinGW compilers (i686 and x86_x64 versions) from sourceforge
Issue:
In QT Creator, adding the compiler is done without an issue, adding the "Kit" and selecting the newly added compiler, an red exclamation gives an error
The Compiler (x86_windows_msys_pe_64bit) cannot produce code for QT version 5.7.0 GCC 64Bit (x86_linux_generic_elf_64bit)
This occurs for both 32 + 64 bit compilers.
I think that you should have a QT version that matches your compiler ABI. The error tells you that the MinGW compiler doesn't match the Linux version of QT you have used. Therefore, get a windows version of QT and use it instead (just as you've added WinGW).
You can download Qt Binaries from here.

Compiler issue with Qt 5.4.1

I am now using Qt 5.4.1, the latest version of Qt. But just now I encounter some bug. I guess it's because I use the wrong compiler.
By many document's suggestion, we are supposed to use the mingw compiler for qt. But, no MingW detected in my computer is suited for the Qt 5.4.1. Only the Microsoft Visual C++ compiler 12.0 x86_amd64 is ok.
I have install two mingw in my computer(one of which is 4.8.1 I guess). But none of them are suited for the qt5.4.1. Not the gcc.exe in C:\MinGW\bin, nor the mingw32-gcc.exe and mingw32-gcc-4.8.1.exe in C:\MinGW\bin
Also, I try the gcc.exe and g++.exe in D:\GCC\gcc\bin, but it's also the same.
Why is that? Thank you.

Where can I download GCC 4.3.2 binaries for Windows?

I have to write a c++ program, and i want to do this in vstudio 2010, because it's the most comfortable way for me. But later this code will be compiled in gcc 4.3.2 (ejudge). I can't find gcc 4.3.2 binaries for Windows, if there any ways to check correctness of gcc compilation? Or maybe anyone will help to find gcc binaries? I found this link http://tdm-gcc.tdragon.net/download but there i can't find 4.3.2 version binaries, only source code. Thanks.
MinGW, or Minimalist GNU for Windows, is a set of GNU compilers for Windows platforms. It's the easiest way to use G++ on windows platform. You could also use Cygwin, but it would be a bit of overkill.
As I recall g++ 4.3.2 was used in an older version of the Code::Blocks IDE, as the bundled compiler.
However, I'm currently unable to connect to [http://www.codeblocks.org], so I don't know if they provide downloads of older versions.