I just made a clean install of the following tools on Windows 7:
MinGW / GCC 4.8.1
Qt 4.8.5
Qt Creator 2.8.1
In the PATH there is: C:\Qt\4.8.5\bin;C:\Qt\4.8.5\include;C:\Qt\4.8.5\lib;C:\MinGW\bin;
1) I read the warning about the fact that Qt 4.8 needs GCC 4.6. I ignored it, using GCC 4.8.1. So this could be an issue.
2) I successfully installed Qt Creator. I successfully built the default Qt GUI application. When launched I get the error: "The program has unexpectedly finished." Debugging I get a segmentation fault before entering main(), in the qatomic_i386.h file, in the QBasicAtomicInt::deref() member function.
If I build a cmake based console application, everything is fine.
3) If I build a previous Qt cmake based project (either from the command line or from Qt Creator), this is what I get (out of tree build):
The first time I run cmake:
MyPrj-build>cmake -G "MinGW Makefiles" ..\MyPrj
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeMinGWFindMake.cmake:20 (message):
sh.exe was found in your PATH, here:
C:/Program Files (x86)/Git/bin/sh.exe
For MinGW make to work correctly sh.exe must NOT be in your path.
Run cmake from a shell that does not have sh.exe in your PATH.
If you want to use a UNIX shell, then use MSYS Makefiles.
Call Stack (most recent call first):
CMakeLists.txt:6 (PROJECT)
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:S:/MyPrj/MyPrj-build/CMakeFiles/2.8.11.2/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:S:/MyPrj/MyPrj-build/CMakeFiles/2.8.11.2/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
The second time:
S:\MyPrj\MyPrj-build>cmake -G "MinGW Makefiles" ..\MyPrj
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:1382 (message):
Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
CMakeLists.txt:12 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
Is it normal to have these different behaviours in the first and second cmake run?
Why cannot the system find Qt4?
Are these three issues dependent on each other?
How did you "install" your Qt? The only way of "installing" it in your case is to build it from the sources. Generally, you need to use the same compiler to compile Qt as you use to compile your Qt-using project. Some C++ compiler version mismatches might work, but you've just shown that your combination doesn't.
Related
I use Rtools c++ compiler to compile a github repo via cmake, and error says that C++ compiler Rtools/mingw_64/bin/g++.exe is not able to compile a simple test program.
devtools::install_github("tractatus/wholebrain", args='--no-multiarch')
.....
.....
-- The CXX compiler identification is GNU 4.9.3
-- The C compiler identification is GNU 4.9.3
-- Check for working CXX compiler: C:/Rtools/mingw_64/bin/g++.exe
-- Check for working CXX compiler: C:/Rtools/mingw_64/bin/g++.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler
"C:/Rtools/mingw_64/bin/g++.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Windows/Temp/RtmpuqHViQ/R.INSTALL5c036fc6900/ROpenCVLite/src/opencv-4.0.1/build64/CMakeFiles/CMakeTmp
Run Build Command:"C:/Rtools/bin/make.exe" "cmTC_96862/fast"
/Rtools/bin/make -f CMakeFiles/cmTC_96862.dir/build.make CMakeFiles/cmTC_96862.dir/build
make: /bin/sh: Command not found
make: *** [Makefile:121: cmTC_96862/fast] Error 127
and I try to install cmake in another version and rtools, but it seemly not work. So, what's the problem for this?
When i build OpenBR on windows and when i type following code on VS2015 x86 x64 Cross Tools Command Prompt as mentioned in A hacker's guide to building, editing, and running OpenBR :
cmake -G "CodeBlocks - NMake Makefiles" -DCMAKE_PREFIX_PATH="H:/opencv-2.4.11/build/install;H:/Qt/Qtââ5.8/5.8/msvc2015_6ââ4" -DCMAKE_INSTALL_PREFIX="./install" -DBR_INSTALL_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=Release ..
i get this error :
H:\openbr\build-msvc2015>cmake -G "CodeBlocks - NMake Makefiles" -DCMAKE_PREFIX_
PATH="H:/opencv-2.4.11/build/install;H:/Qt/Qt5.8/5.8/msvc2015_64" -DC
MAKE_INSTALL_PREFIX="./install" -DBR_INSTALL_DEPENDENCIES=ON -DCMAKE_BUILD_TYPE=
Release ..
-- The C compiler identification is MSVC 19.0.23506.0
-- The CXX compiler identification is MSVC 19.0.23506.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/bin/x86_amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o 14.0/VC/bin/x86_amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studi
o 14.0/VC/bin/x86_amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- OpenCV ARCH: x64
-- OpenCV RUNTIME:
-- OpenCV STATIC: OFF
CMake Warning at H:/opencv-2.4.11/build-msvc2015/install/OpenCVConfig.cmake:161
(message):
Found OpenCV Windows Pack but it has not binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
CMakeLists.txt:88 (find_package)
CMake Error at CMakeLists.txt:88 (find_package):
Found package configuration file:
H:/opencv-2.4.11/build-msvc2015/install/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
-- Configuring incomplete, errors occurred!
See also "C:/openbr/build-msvc2015/CMakeFiles/CMakeOutput.log".
what's problem?
Try to edit OpenCVConfig.cmake file (H:/opencv-2.4.11/build-msvc2015/install/OpenCVConfig.cmake). And set OpenCV_RUNTIME to VC14:
elseif(MSVC_VERSION EQUAL 1800)
set(OpenCV_RUNTIME vc12)
elseif(MSVC_VERSION EQUAL 1900)
set(OpenCV_RUNTIME vc14)
endif()
I am trying to compile Blochlibs-1.2 libraries on Ubuntu 15.04 (32 bit). Ihave successfully compiled fftw3 and mpi libraries which all ended up in /usr/local/lib and usr/local/include. mpicc is in the path and LD_LIBRARY_PATH is set correctly. when I run configure like this:
./configure --with-mpi=/usr/local --with-fftw=/usr/local
then i get this error:
checking for functioning MPI library ... configure: error: couldn't
find mpi library for --with-mpi
How does the configure file search for the libraries?
Thanks,
Z
I have a problem building an application from Qt Creator; from the configure step, I get this error:
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:1382 (message):
Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
CMakeLists.txt:13 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
If I configure it from the command line, everything is file:
cmake -G "MinGW Makefiles" ..\ProjectDir
In the paths environment variable Qt is present (src, bin and lib paths).
Platform:
Windows 7
MinGW/GCC 4.4
CMake 2.8.11
Qt 4.8.5
Qt Creator 2.8.1
When you want to develop a CMake based project with Qt Creator, you should not execute CMake manually before. Qt Creator generates a Code::Blocks project from your source to work with CMake, so if you generate with -G "MinGW Makefiles" it will not work.
Instead, you could try the following steps:
In Qt Creator, Open Project > Select the top level CMakeLists.txt
Set a build directory somewhere close to the CMakeLists.txt or in its parent folder, then click on Next
Select your generator (Combination of a Qt version and a compiler)
[optional] set some CMake arguments
Click on Execute CMake, then Finish
Your project should now be opened in Qt Creator and ready for development
I am getting the following error, when I run programs in debug mode.
cannot find -lQtCored
collect2: ld returned 1 exit status
I can run programs normally in release mode. Is it because I have done static linking (I can run my executable without Qt Creator)?
I am using Qt Creator with Qt 4.7.0 on Windows.
The following command would solve this issue:
sudo apt-get install libglu1-mesa-dev
Your linker can not see debug library of QtCore (as shown - -lQtCored, release lib - -lQtCore).
You need checked, really you build this debug library or not, then checked all pathes to this debug library.
PS. Yes, you can run executable without Qt-Creator. You should use qmake (into directory with your .pro) and make (when your qmake has generate Makefile).
PSS. If you want to run .exe then you should put some Qt libraries into directory with .exe.