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.
Note: I'm basing my answer more on [SO]: openCV mingw-32 error in cmd (the tools versions mentioned in the posted .pdf)
1. Preliminary considerations
At the beginning, I tried to build it using what I already had on my machine (Win 10):
CMake 3.6.4 (bundled by Android Studio - that I didn't updated for months BTW), cmdline - as there's no GUI
MinGW7.2.0 (that I built on my machine for a different task)
g++ 7.2.0
OpenCV 3.4.2 (downloaded [GitHub]: opencv/opencv - opencv-3.4.2.zip, specifically for this task)
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:
Downloaded CMake 3.6.3 Win x64 bundle (that contains cmake-gui - as cmdline can be a pain, especially for those that are not used to it)
Used MinGW 5.3.0 (part of my Qt installation)
g++ 5.3.0
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):
2. Solutions
Both are done at cmake-gui level. After setting the paths:
Hit "Configure"
Do the required variable changes
Hit "Generate"
Launch mingw32-make from console, in the build dir
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
2.1 Force C++11 standard
Click "Add Entry" and set [CMake 3.1]: CXX_STANDARD:
And below, notice that the build passed point where it was failing before:
2.2 Skip Protobuf build
Notes:
In the posted movie, there's no Protobuf build attempted (probably it's not in the bundle?) that's why this error didn't pop up
I don't know what functionality will not be available in the final build, as I don't know what Protobuf is used at
I consider this more like a workaround
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):
Related
My environment is below.
・Operating System and version:windows 10 64bit
・Compiler:C:\msys64\mingw64\bin\g++.exe
・PCL Version:1.9.1
pcl_config.h not found as below error occurred when compiled under above env..
Certainly this header file is not included.
Let me know how to solve it.
PS C:\pcl\pcl\examples\common> g++ -o minmax -I ../../io/include -I ../../common/include .\example_get_max_min_coordinates.cpp
In file included from ../../common/include/pcl/PCLHeader.h:10,
from ../../common/include/pcl/point_cloud.h:47,
from ../../io/include/pcl/io/pcd_io.h:42,
from .\example_get_max_min_coordinates.cpp:2:
../../common/include/pcl/pcl_macros.h:64:10: fatal error: pcl/pcl_config.h: No such file or directory
#include
^~~~~~~~~~~~~~~~~~
compilation terminated.
Short answer
pcl_config.h is generated via pcl_config.h.in by the cmake tool. So it seems that compilation did not finish correctly.
Longer answer
Please make sure you have compiled the relevant modules of PCL (at least pcl-core) before proceeding
You might prefer a pre-built installation from releases or distributed by a package/source manager of your choice
PCL makes heavy use of other libraries and it is best to supply the dependencies (as mentioned below) via CMake or manually via the -I and -l options. If you provide the location of pcl_config.h, the compiler will complain about Eigen next.
The build instructions are available here. TL;DR: After satisfying the dependencies (cmake, c++ compiler, boost, eigen, flann, vtk and other depending on use-case), run the following commands
cd $PCL_SOURCE_DIR
mkdir -p build; cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8
Feel free to use any build generator (like Ninja) or change build type to Debug or RelWithDebInfo as per your needs.
Moved from here, because it's about compiling software.
My original problem: I want to play Super Mario Galaxy 2 with another player. But whatever keys I assign to move the cursor, it instead moves it all the way to the corner (or edge) of the screen. Linux theoretically has the ability to have multiple cursors (at least the display system "X" allows it), but from a research it looks like I would have to make major changes to the system to actually use it. And even then I doubt that Dolphin would support it.
My current problem: Relative motion of a cursor from keys is present in the current betas of Dolphin, but I can't get it installed. There are no regular installers for it, instead there are source downloads and this tutorial.
I installed the dependencies, downloaded the beta, created and entered the "Build" directory, but when I try cmake .., I get this output:
-- Detected architecture: x86_64
-- X11 support enabled
-- Xrandr found
-- Found avcodec: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libavcodec.so
-- Found avformat: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libavformat.so
-- Found avutil: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libavutil.so
-- Found swresample: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libswresample.so
-- Found swscale: /usr/include/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libswscale.so
-- libav/ffmpeg found, enabling AVI frame dumps
-- libevdev/libudev found, enabling evdev controller backend
-- Using named pipes as controller inputs
-- Watching game memory for changes
-- Enabling analytics collection (subject to end-user opt-in)
-- Using static enet from Externals
-- Using static xxhash from Externals
-- Using shared zlib
-- Using static lzo from Externals
-- Using shared libpng
-- Using shared LibUSB
-- Found SFML 2.4 in /usr/include
-- Using shared SFML
-- Using shared miniupnpc
-- Could NOT find MBEDTLS (missing: MBEDTLS_VERSION_OK)
-- Using static mbed TLS from Externals
-- Using shared libcurl
-- Using static DiscordRPC from Externals
-- libsystemd found, enabling traversal server watchdog support
-- Using static gtest from Externals
-- Could NOT find OpenSLES (missing: OPENSLES_LIBRARY OPENSLES_INCLUDE_DIR)
-- ALSA found, enabling ALSA sound backend
-- PulseAudio found, enabling PulseAudio sound backend
-- BlueZ found, enabling bluetooth support
CMake Error at Source/Core/DolphinQt/CMakeLists.txt:1 (find_package):
Could not find a configuration file for package "Qt5" that is compatible
with requested version "5.9".
The following configuration files were considered but not accepted:
/usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake, version: 5.7.1
-- Configuring incomplete, errors occurred!
See also "/home/fabian/dolphin_beta/dolphin-emu/Build/CMakeFiles/CMakeOutput.log".
See also "/home/fabian/dolphin_beta/dolphin-emu/Build/CMakeFiles/CMakeError.log".
The output of apt-file search Qt5Config.cmake is:
libaccounts-qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/AccountsQt5/AccountsQt5Config.cmake
libphonon4qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/phonon4qt5/Phonon4Qt5Config.cmake
libsignon-qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/SignOnQt5/SignOnQt5Config.cmake
libtelepathy-qt5-dev: /usr/lib/x86_64-linux-gnu/cmake/TelepathyQt5/TelepathyQt5Config.cmake
qtbase5-dev: /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake
To be safe I installed all five of these packages. I also installed version 5.10 of Qt5-default from here, later also 5.11. I also installed qtbase5-private-dev, libreadline-dev and tried to install libpolarssl-dev, but the page gave error messages for all four servers (the Taiwanian one just loads forever, the others give 404). Then I tried the Qt installer and selected the latest stable version (5.11 I think) once and 5.9 once.
None of these steps helped, I still get the same output as at the beginning.
Here is a copy of CMakeOutput.log from when I last tried installing: https://pastebin.com/EP5qDGE9
Here is a copy of CMakeError.log from when I last tried installing: https://pastebin.com/9p4Ni0jE
My specs:
Debian 9.5
Cinnamon 3.2.7
Linux Kernel 4.9.0-8-amd64
Installed packages: https://pastebin.com/DeYAvJtu
Many thanks to the user dugan on linuxquestions.org! He solved my problem here.
I just had to install Qt from a different source (I used the Qt installer, as mentioned in the question), to have a different version of it in another location. The reason for that is that many programs on Debian rely on an earlier version of Qt, so just updating it would break a lot, that's also why Synaptic&Co. don't update it.
Then I had to add the binary to the PATH variable, like so:
export PATH=/home/fabian/Qt/5.11.2/gcc_64/bin:$PATH
Then I was able to just install Dolphin beta regularly, like the tutorial says it.
I have prepared a package in R by using RcppArmadillo and OpenMP libraries and following commands:
RcppArmadillo.package.skeleton("mypackage")
compileAttributes(verbose=TRUE)
Also, in the DESCRIPTION file I added:
Imports: Rcpp (>= 0.12.8), RcppArmadillo
LinkingTo:Rcpp, RcppArmadillo
Depends: RcppArmadillo
and in the NAMESPACE file I added:
import(RcppArmadillo)
importFrom(Rcpp, evalCpp)
Then I run the following codes in cmd:
R CMD build mypackage
R CMD INSTALL mypackage.tar.gz
I build and install the package in my computer and I use it now. But my colleges and friends are not able to install the package. The error messages is about RcppArmadillo and OpenMPlibraries.
For instance:
fatal error: 'omp.h' file not found
Does anyone have previous experience in this case? Which type of settings I have to do in my package for solving this problem?
Congratulations! You've most likely stumbled across macOS' lack OpenMP support. This has been documented in the Rcpp FAQ as entry 2.10.3.
Defensive coding
The reason for the error being apparent is you did not protect the OpenMP code appropriately... e.g.
Header inclusions are protected with:
#ifdef _OPENMP
#include <omp.h>
#endif
Code has protections given by:
#ifdef _OPENMP
// multithreaded OpenMP version of code
#else
// single-threaded version of code
#endif
This assumes you are not using the preprocessor #omp tags but more indepth omp function calls. If it is the prior, then the code protection is not important as the preprocessor tags will be discarded.
(For those long time users of the above macro schemes coming here, please note that as of R 3.4.0, the SUPPORT_OPENMP definition was removed completely in favor of _OPENMP.)
Creating a package requirement for OpenMP via configure.ac
However, the above is just good defensive coding. If your package requires a specific feature, then it may be time to consider using an autoconf file called configure.ac to generate a configure script.
Place the configure.ac in the top level of your package.
packagename/
|- data/
|- inst/
|- man/
|- src/
|- Makevars
|- HelloWorld.cpp
|- DESCRIPTION
|- NAMESPACE
|- configure.ac
|- configure
The configure.ac should contain the following:
AC_PREREQ(2.61)
AC_INIT(your_package_name_here, m4_esyscmd_s([awk -e '/^Version:/ {print $2}' DESCRIPTION]))
AC_COPYRIGHT(Copyright (C) 2017 your name?)
## Determine Install Location of R
: ${R_HOME=$(R RHOME)}
if test -z "${R_HOME}"; then
AC_MSG_ERROR([Could not determine R_HOME.])
fi
## Setup RBin
RBIN="${R_HOME}/bin/R"
CXX=`"${RBIN}" CMD config CXX`
CPPFLAGS=`"${RBIN}" CMD config CPPFLAGS`
CXXFLAGS=`"${RBIN}" CMD config CXXFLAGS`
## Package Requires C++
AC_LANG(C++)
AC_REQUIRE_CPP
## Compiler flag check
AC_PROG_CXX
## Borrowed from BHC/imager/icd/randomForest
# Check for OpenMP
AC_OPENMP
# since some systems have broken OMP libraries
# we also check that the actual package will work
ac_pkg_openmp=no
if test -n "${OPENMP_CFLAGS}"; then
AC_MSG_CHECKING([OpenMP detected, checking if viable for package use])
AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <omp.h>]], [[ return omp_get_num_threads (); ]])])
"$RBIN" CMD SHLIB conftest.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD && "$RBIN" --vanilla -q -e "dyn.load(paste('conftest',.Platform\$dynlib.ext,sep=''))" 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD && ac_pkg_openmp=yes
AC_MSG_RESULT([${ac_pkg_openmp}])
fi
# if ${ac_pkg_openmp} = "yes" then we have OMP, otherwise it will be "no"
if test "${ac_pkg_openmp}" = no; then
AC_MSG_WARN([No OpenMP support. If using GCC, upgrade to >= 4.2. If using clang, upgrade to >= 3.8.0])
AC_MSG_ERROR([Please use a different compiler.])
fi
# Fin
AC_OUTPUT
To generate the configure script, run:
autoconf
Once this is done, you will need to rebuild your package. Note, you may need to install autoconf if on Windows and on macOS you likely need to install it via homebrew.
Helping users get a viable OpenMP compiler
Now, you may want to ensure your colleagues are able to get the speedup gain from your OpenMP-enabled code. To do so, one must enable OpenMP by having your colleagues shift away from using the default system compiler to either a "true" gcc or a viable omp enabled clang compiler.
Instructions for both on macOS are given here:
http://thecoatlessprofessor.com/programming/openmp-in-r-on-os-x/
I have an existing Qt5.3.2 installation from tar.gz source files.
When attempting to compile VTK, which has optional Qt{4,5} interface, I was informed I don't have QtWebKitWidgets by ccmake.
I don't particularly want to reinstall Qt5 on top of the existing installation, for fear of breaking other things built against it.
Can I add to my current Qt5?
Would variants on
/path/to/configure -release -prefix $existingPrefix
make -module-qtwebkit
make install
or
/path/to/configure -release -prefix $newPrefix
make -module-qtwebkit
make install
cp -rf $newPrefix/CMake/QtWebKit (or similar path) $existingPrefix/CMake/
or as above, but with symlink, work?
Qt5.3 no longer includes QtWebKit, which should now be built separately.
The WebKit package can be downloaded from the Qt Downloads website, via the separate packages repository: link for 5.3.2
This can then be installed by appropriately setting environment variables such that the relevant (Qt5.3.2) qmake is first in the path, then from the expanded source directory, typing:
qmake
make -jN (with N make jobs)
(sudo, if appropriate) make install
The download is approximately 50MB.
Edit: It's also worth noting that if your Bison version is 3.x, then you might not be able to build the snapshot for QtWebKit. Instead download from the development repositories, to avoid an error looking something like: link to bug report
g++ -c [...] -o .obj/release-shared/generated/glslang_tab.o generated/glslang_tab.cpp
generated/glslang_tab.cpp: In function 'int yyparse(TParseContext*)':
generated/glslang_tab.cpp:1785:30: error: too few arguments to function 'int yylex(YYSTYPE*, void*)'
yychar = yylex (&yylval);
^
generated/glslang_tab.cpp:279:12: note: declared here
extern int yylex(YYSTYPE* yylval_param, void* yyscanner);
In the code file i have to link just one library (from gi.repository import Gtk).
But when i run it it replies me:
Gtk-WARNING **: Unknown property: GtkTextView.input-purpose
ERROR --file: collega_GUI --riga: 160, 'Grid' object has no attribute
'get_child_at'
So i tried to find missing libraries:
$ dpkg -l libgtk[0-9]* | grep ^i
ii libgtk2.0-0 2.24.10-0ubuntu6 GTK+ graphical user interface library
ii libgtk2.0-bin 2.24.10-0ubuntu6 programs for the GTK+ graphical user interface library
ii libgtk2.0-common 2.24.10-0ubuntu6 common files for the GTK+ graphical user interface library
ii libgtk2.0-dev 2.24.10-0ubuntu6 development files for the GTK+ library
and Grid object needs gtk3+, so let's install it:
$ sudo apt-get install libgtk-3-0 libgtk-3-common libgtk-3-dev libgtk-3-doc
0 updated, 0 installed, 0 removed and 0 not upgraded
So it's all fine with libraries and:
gtk-grid-get-child-at exists
GtkTextView--input-purpose exists
that "input-purpose" problem is strange, because on the previous OS (ubuntu 13.10, now i'm on 12.04) i didn't get that problem.
The UI is built by Glade, but i never get that error previously: on the same project files, but on a different OS version.
I still think i need to install some libraries.
EDIT :: ged_child_at function call
griglia = self.__builder.get_object('grid3')
for i in range(0, 3):
area = griglia.get_child_at(i, 0)
self.__builder.get_object(Gtk.Buildable.get_name(area)).connect("draw", self.draw)
The tag Since 3.6 for that property which means in Gtk+ 3.4 (which is the default of ubuntu 12.04 if I recall correctly).
So you either work around it or you go the thorny way of upgrading to Gtk+ 3.6 - which I - with all respect - do strongly disrecommend - especially since Unity needs various patches being incorporated into Gtk+ to work at all.
I just checked in gtk+-3.10.x the python bindings are fine and include get_child_at(..).
This question contains an answer that in fact this is a bug in the python bindings of gtk+ 3.4.
Solutions: Backport the git commit that fixes this (should be very tiny git commit) recompile/create deb package (significant knowledge required).
An alternate route would be to locally fix the binding specification and recreate the python introspection bindings locally - not sure if that is possible though - never did that.