Qt Cmake error compilation "GuiSupportQt not found" - c++

I'm new to Qt and i already have a problem so i start to create a simple UI for my VTK project, first of all, i tested a sample project UI designed by Qt in Qt 5.5.0 and compiled in Cmake 3.10 and VS2013 programmed with C++, and i've got a line after compiling with Cmake before "Configuration done" saying that"GuiSupportQt not found." i ignored it and generated solution then i gone to VS2013 to compile the solution provided by Cmake , i didn't find my project after opening solution in VS2013, i found only the common 2 projects that are named ALL_BUILD and ZERO_CHECK.
For more info, i've compiled before a non Gui project (3d vtk visualisation with vtk rendered without Qt) which is my own homework project and i've got a successful results which means in my opinion that the problem appears exactly when i compile a project that uses Qt considering that my Qt-VTK are compiled before with Cmake and built with VS2013 without any errors.
This is the code of Qt project sample that i used to test :
https://vtk.org/Wiki/VTK/Examples/Cxx/Qt/RenderWindowUISingleInheritance
This is what i get when i try to compile it with Cmake :
The C compiler identification is MSVC 18.0.21005.1
The CXX compiler identification is MSVC 18.0.21005.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/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 Studio 12.0/VC/bin/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
VTK_VERSION: 7.1.1
GuiSupportQt not found.
Configuring done
Generating done

After looking a while i found out another tricky solution to evade problems since i had Vtk visualisation part work fine and i work on windows, so i just sent parameters via command in cmd using Qt gui and then Vtk project compiled exe file will take parameters in execution (iso-value,data folder name..ect) in argv[] array then launch it in a new window, so i didn't have to compile Qt project with Cmake.

Related

CMake with Boost library Windows 10 Library not found correctly

Like many others i have problems using boost libraries with windows. On Ubuntu 16.04 it works all very well with libboost-all-dev but on windows i have many problems.
I try to build a cryptonote application which i can compile completely without any errors under linux. But i need also windows binaries so i did the steps to install the following tools:
Visual Studio 2013 (vc120)
CMake 3.10.1
Python 3.6.4
Boost 1.58
For boost i did the following steps:
Installing boost from binary
Run bootstrap.bat
Run b2 install
Run bjam install "--with-some-libs"
Nothing works. The cryptonote throws me an error that some but not all libraries could not be found.
I tried to set the BOOST_ROOT, BOOST_LIBRARY_DIRS, BOOST_INCLUDE_DIRS -> Nothing.
What i did wrong? The error i get from cmake is this:
-- Building for: Visual Studio 12 2013
-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/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 Studio 12.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:1928 (message):
Unable to find the requested Boost libraries.
Boost version: 1.58.0
Boost include path: C:/local/boost_1_58_0
Could not find the following static Boost libraries:
boost_system
boost_filesystem
boost_thread
boost_date_time
boost_chrono
boost_regex
boost_serialization
boost_program_options
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
CMakeLists.txt:113 (find_package)
-- WARNING: Git was not found!
-- Found PythonInterp: C:/Users/chris/AppData/Local/Programs/Python/Python36-32/python.exe (found version "3.6.4")
CMake Warning in CMakeLists.txt:
CMAKE_SKIP_INSTALL_RULES was enabled even though installation rules have
been specified
-- Configuring incomplete, errors occurred!
See also "C:/Users/chris/Documents/GitHub/cryptonote/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/chris/Documents/GitHub/cryptonote/build/CMakeFiles/CMakeError.log".
Maybe someone can help to fix this issue ?
Greetings
Ok finally i've found a solution after reading many, many and many more pages on the internet.
The solution is really simple. After downloading the boost package and installing it (or building from source) you just need the following two parts:
Open your CMD (cmd.exe)
switch to your installation directory of boost (example C:\local\boost_1_58_0)
Just run the following commands:
bootstrap.bat
b2 link=static runtime-link=static release stage
This will create all librarys static and makes it useable for cmake.
This solution works for me and made me able to build the needed package.
Thanks for all helpers
Or you could just tell boost which compiler to use by adding
toolset=msvc-12.0
(for MS 2013 v12, etc.)
to the b2 command line :-)

AMQP-CPP RabbitMQ Build Integrating to CPP Project

Hi I currently try to integrate RabbitMQ via AMQPCPP into my VisualStudio Project. I am restricted to use a Windows PC which is a pain in the ass for the installation.
I think I was able to build the Project using CMAKE But I received some Error doing it . Now I am trying to include the build into the VS2017 Project. In the Readme https://github.com/CopernicaMarketingSoftware/AMQP-CPP this is done using
#include <amqpcpp.h>
But this header is not found in my build. I am not used to CPP so I hope I havent done some rudimental error. Thanks in advance!
Steps to build AMQP-CPP using CMake in Windows - Visual Studio 2017
Open command prompt and switch to AMQP-CPP git/source path.
1) >mkdir build
2) >cd build
3) >cmake -G "Visual Studio 15 2017 Win64" ..\
-- Selecting Windows SDK version 10.0.15063.0 to target Windows 6.1.7601.
-- The C compiler identification is MSVC 19.10.25019.0
-- The CXX compiler identification is MSVC 19.10.25019.0
-- Check for working C compiler: E:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe
-- Check for working C compiler: E:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: E:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe
-- Check for working CXX compiler: E:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.10.25017/bin/HostX86/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Projects/AMQP-CPP/build
4) >cmake --build . --target ALL_BUILD --config RELEASE --clean-first -- /m
Build succeeded.
"D:\Projects\AMQP-CPP\build\ALL_BUILD.vcxproj" (default target) (1) -> "D:\Projects\AMQP-CPP\build\amqpcpp.vcxproj" (default target) (3) -> (ClCompile target) ->
D:\Projects\AMQP-CPP\src\deferredreceiver.cpp(48): warning C424
4: 'argument': conversion from 'uint64_t' to 'uint32_t', possible loss o
f data [D:\Projects\AMQP-CPP\build\amqpcpp.vcxproj]
1 Warning(s)
0 Error(s)
Time Elapsed 00:00:44.16
How to include amqpcpp in your project
Edit your project CMakeLists.txt file for adding amqpcpp include path and library path for linking.
include_directories(../include)
link_directories(../build/bin/Release)
Include and link directory path may differ based on actual location in your machine.

CMake: How to specify VS2015.3 toolset with VS2017 installed

I have VS2017 installed, with both VS2017 (v141) and VS2015.3 (v140) toolset installed. I need to generate a solution with CMake and I want CMake to be "fooled" as if VS2015 is installed, so I can build the project with v140 toolset.
I know this question is possibly a duplicate of:
How cmake specify "Platform Toolset" for a Visual Studio 2015 project?
But the solution it provides doesn't help me.
The error messages are:
Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.15063.
The C compiler identification is unknown
The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:18 (project):
No CMAKE_C_COMPILER could be found.
I tried installing both VS2017 and VS2015.3 (IDE), but VS2015.3 refused to create even a simple console program.
Is there another way to generate a solution with v140 toolset?
(P.S. Don't tell me that I should generate with v141 toolset first and modify the toolset option in Visual Studio. That makes a big difference. )
I've just ran a test and it works for me with the following settings in CMake's GUI (Version 3.10.0 RC4):
Then I get the following output:
The CXX compiler identification is MSVC 19.0.24215.1
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Configuring done
Generating done
And if I open the resulting solution it will - as expected - ask me:
Platform Toolset Mapping
From Marco Foco: Microsoft Visual C++ version Map:
If that don't work ...
First please check the CMakeError.log in your binary output directory. The error should give you a lead on what's wrong.
If that's not helping, you can try several things (besides re-installing VS, which I think won't solve the problem):
One of the Windows SDKs is not fully/correclty installed; Reinstall from Microsoft's web site
Try to give the cmake-gui administrative rights
Check if there is a GNU toolchain with GCC compiler in your PATH environment.
References
VS 2010 and CMake: 'rc' is not recognized as an internal or external command
MSBuild.exe has stopped cmake error
Environment variable used by CMake to detect Visual C++ compiler tools for Ninja

Cmake Visual Studio 2015 Identification Unknown

So basically i am trying to use Cmake to build a project i am working on, the project uses GLEW (as shared library). GLEW links to both glu32.lib and opengl32.lib. They are added to the CMakelists.txt of glew on the target_link_libraries call like:
target_link_libraries(glew PUBLIC opengl32 glu32)
When i try to generate code for using the viusal studio compiler (2015 Community). I get problems with CMake adding the link libraries to the Visual studio project with -lopengl32 and -lglue32. This is wrong since visual studio cant handle this and gives met the following error when trying to compile:
LINK : warning LNK4044: unrecognized option '/lglu32.lib';
LINK : warning LNK4044: unrecognized option '/lopengl32.lib';
The output of running the Visual Studio Generator is:
C:\Project\build>cmake .. -G "Visual Studio 14 2015 Win64"
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler using: Visual Studio 14 2015 Win64
-- Check for working C compiler using: Visual Studio 14 2015 Win64 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 14 2015 Win64
-- Check for working CXX compiler using: Visual Studio 14 2015 Win64 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found OpenGL: opengl32
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Project/build
The following two lines:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
seem quite odd to me since it is able to run the Visual Studio compiler. I read something about this being the cause of the invalid -l addition to the linker.
Is there anyone that had this problem and knows how to solve it?
Thanks in advance
CMakeError.txt:
Compilation of the C compiler identification source "CMakeCCompilerId.c" did not produce an executable in "C:Project/build/CMakeFiles/3.5.2/CompilerIdC".
Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" did not produce an executable in "C:/Project/build/CMakeFiles/3.5.2/CompilerIdCXX".
After spending some time searching i fixed it! The actual path of the project i was trying to build contained a SPACE in its path. Appearantly CMake can't handle this.

CMake could not find SDL2

I want to add this library to my project. However, it does not come with pre-compiled files. It asks me to build the library myself with cmake, which I am not familiar with. One of its dependencies is SDL2. So I download the sdl2 development libraries folder. In cmake, I click configure and choose the generator. After a couple of seconds processing, a window pops up showing the error: Error in configuration process project files may be invalid
And this is what the log screen shows:
The C compiler identification is MSVC 18.0.40629.0 The CXX
compiler identification is MSVC 18.0.40629.0 Check for working C
compiler using: Visual Studio 12 2013 Check for working C compiler
using: Visual Studio 12 2013 -- works Detecting C compiler ABI
info Detecting C compiler ABI info - done Check for working
CXX compiler using: Visual Studio 12 2013 Check for working CXX
compiler using: Visual Studio 12 2013 -- works Detecting CXX
compiler ABI info Detecting CXX compiler ABI info - done
Detecting CXX compile features Detecting CXX compile features -
done CMake Error at C:/Program Files
(x86)/CMake/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:148
(message): Could NOT find SDL2 (missing: SDL2_INCLUDE_DIR
SDL2_LIBRARY) Call Stack (most recent call first):
C:/Program Files
(x86)/CMake/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:388
(_FPHSA_FAILURE_MESSAGE) cmake/FindSDL2.cmake:18
(FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:30 (FIND_PACKAGE)
Configuring incomplete, errors occurred! See also "E:/game
dev/libraries/libSDL2pp-master/build/CMakeFiles/CMakeOutput.log".
Could anyone tell me what to do? I am not sure that I am doing the right thing.
cmake doesn't come with a module for finding sdl2 by default. That's most likely the reason why you provided your own in cmake/FindSDL2.cmake. As you are on windows, it is most likely that you have to set an environment variable to point to the sdl2 installation directory (but this is really something that depends on the FindSDL2.cmake that you use).