Reputation: 11
I install Qt 5.10 latest version and opencv3.4.1 and I couldn't install the library in this version of Qt with Cmake can anybody help me to do it on my windows 10 64-bit please? I tried with this video also https://www.youtube.com/watch?v=ZOSu-2Oju-A and in cmd step I have this (picture in this link)
in this link also (( https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows )) I do all steps carefully but I didn't found the folder bin in opencv-build after do the steps and My OS is windows 10 64-bit thanks for help.
Upvotes: 1
Views: 2416
Reputation: 41116
Note: I'm basing my answer more on [SO]: openCV mingw-32 error in cmd (the tools versions mentioned in the posted .pdf)
At the beginning, I tried to build it using what I already had on my machine (Win 10):
The build process passed this stage (well, it failed somewhere below this point, I didn't check why exactly).
Anyway, I thought that the build env that I used, and the suggested one were too far away, so I:
The problem at its core (as specified in comments, or Googleing the error) is that the g++ compiler doesn't use the C++11 standard (and protobuf source code requires it).
So, I did a little test: pasted the faulty code in a file (and added a dummy main), and tried it with the 2 MinGW installations.
code00.cpp:
template <typename char_type>
bool null_or_empty(const char_type *s) {
return (s == nullptr) || (*s == 0);
}
int main() {
return 0;
}
Output:
[cfati@CFATI-5510-0:e:\Work\Dev\StackOverflow\q049459395]> sopr.bat *** Set shorter prompt to better fit when pasted in StackOverflow (or other) pages *** [prompt]> dir /b build build.bat cmake-gui.exe - Shortcut.lnk code.cpp src [prompt]> set _PATH=%PATH% [prompt]> set PATH=%_PATH%;c:\Install\x64\MinGW32\MinGW32\7.2.0-posix-seh-rt_v5-rev1\mingw64\bin [prompt]> "c:\Install\x64\MinGW32\MinGW32\7.2.0-posix-seh-rt_v5-rev1\mingw64\bin\g++" code.cpp [prompt]> "c:\Install\x64\MinGW32\MinGW32\7.2.0-posix-seh-rt_v5-rev1\mingw64\bin\g++" --version g++ (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 7.2.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [prompt]> dir /b a.exe build build.bat cmake-gui.exe - Shortcut.lnk code.cpp src [prompt]> del /q a.exe [prompt]> set PATH=%_PATH%;c:\Install\Qt\Qt\Tools\mingw530_32\bin [prompt]> "c:\Install\Qt\Qt\Tools\mingw530_32\bin\g++" code.cpp code.cpp: In function 'bool null_or_empty(const char_type*)': code.cpp:3:17: error: 'nullptr' was not declared in this scope return (s == nullptr) || (*s == 0); ^ [prompt]> "c:\Install\Qt\Qt\Tools\mingw530_32\bin\g++" --version g++ (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [prompt]> "c:\Install\Qt\Qt\Tools\mingw530_32\bin\g++" code.cpp -std=c++0x [prompt]>
As seen, the older g++ needs -std=c++0x
explicitly.
Following the build steps, I got the same error as in the image below (I launched mingw32-make directly in protobuf's dir, to skip all the other stuff built before it):
Both are done at cmake-gui level. After setting the paths:
Notes:
Since I'm very far away from being a CMake expert, before doing this, I empty the build dir to make sure that there's nothing left from previous build (of course the drawback is that everything is done again, which usually takes a long time)
Since I didn't enable parallel build, I didn't wait for the full build to finish (as it takes forever), but just checked that it passes this point
Click "Add Entry" and set [CMake 3.1]: CXX_STANDARD:
And below, notice that the build passed point where it was failing before:
Notes:
Search for Protobuf related variables, and uncheck any that are in the BUILD or WITH groups (the blue lines):
And again the effect is below - the Protobuf build no longer takes place (it comes just after libIlmImf):
Upvotes: 1