Private Headers issue compiling QtWebKit 5.212 against Qt 5.10.1 - c++

On Windows 10, Visual Studio 2015, I'm building QtWebKit (5.212) against Qt 5.10.1, and I'm running into an error during the configuration part of the build.
Here is the command line I use:
perl Tools\Scripts\build-webkit --qt --release --only-webkit --no-ninja --cmakeargs="-Thost=x64 -DCMAKE_GENERATOR_PLATFORM=x64" -G \"Visual Studio 14 2015 Win64\" --prefix=E:\Qt-5.10.1\QtWebKitBin -v
Here is the error:
-- Performing Test Qt5Gui_PRIVATE_HEADER_FOUND
-- Performing Test Qt5Gui_PRIVATE_HEADER_FOUND - Failed
CMake Error at Source/cmake/OptionsQt.cmake:75 (message):
Header private/qhexstring_p.h is not found. Please make sure that:
1. Private headers of Qt5Gui are installed
2. Qt5Gui_PRIVATE_INCLUDE_DIRS is correctly defined in Qt5GuiConfig.cmake
Call Stack (most recent call first):
Source/cmake/OptionsQt.cmake:612 (CHECK_QT5_PRIVATE_INCLUDE_DIRS)
Source/cmake/WebKitCommon.cmake:50 (include)
CMakeLists.txt:139 (include)
-- Configuring incomplete, errors occurred!
The private header that it's using to do the test does exist in the Qt5 include directory, as one would expect, in this location:
E:\Qt-5.10.1\QtBin\include\QtGui\5.10.1\QtGui\private\qhexstring_p.h
The Qt5GuiConfig.cmake file exists only in the E:\Qt-5.10.1\QtBin\lib\cmake\Qt5Gui directory of the Qt installation (not in the QtWebKit source installation). I don't know if it's making use of this in any way.
What do I need to do to make the build find this directory as desired? Adding 'include\QtGui\5.10.1\QtGui\' to the INCLUDE env var doesn't work, but I don't believe that's the correct solution anyway.
Here are the parts of my environment related to the Qt directories:
INCLUDE = ...;E:\Qt-5.10.1\QtBin\include;E:\Qt-5.10.1\qt-everywhere-src-5.10.1\include
LIB = ...;E:\Qt-5.10.1\QtBin\lib;E:\Qt-5.10.1\qt-everywhere-src-5.10.1\lib
PATH = E:\Qt-5.10.1\qt-everywhere-src-5.10.1\qtbase\bin;E:\Qt-5.10.1\qt-everywhere-src-5.10.1\gnuwin32\bin;E:\Qt-5.10.1\QtBin\bin;...
QtBin is the directory with my compiled Qt 5.10.1.
qt-everywhere-src-5.10.1 is the Qt 5.10.1 source package
Thanks in advance for any help. I couldn't find any answers searching Google or StackOverflow.

According to the wiki, you should try to define CMAKE_PREFIX_PATH to point to your Qt installation
For example :
perl Tools\Scripts\build-webkit --qt --release --only-webkit --no-ninja --cmakeargs="-Thost=x64 -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_PREFIX_PATH=c:\Qt\Qt5.6.0\5.6\msvc2015" -G \"Visual Studio 14 2015 Win64\" --prefix=E:\Qt-5.10.1\QtWebKitBin -v

Build on Windows using build-webkit fails because it was unable to find the location for this header file qhexstring_p.h. How to fix this error and although is not a standard way but it works.
Located the file qhexstring_p.h in your prefix directory, or your
preferred Qt Installation SDK
Go to this file Source\cmake\OptionsQt.cmake and change this
From this CHECK_QT5_PRIVATE_INCLUDE_DIRS(Gui private/qhexstring_p.h)
to this below
CHECK_QT5_PRIVATE_INCLUDE_DIRS(Gui
C:/SDK/qt5-5.7.0-vs2015/qt5-x86-static-release/include/QtGui/5.7.0/QtGui/private/qhexstring_p.h)
The path here must match the path to your Qt installation and to the exact location the missing file is located. This ensures the test to look for the private director for the Qt installation is successful.
Then locate the file Qt5GuiConfig.cmake in your Qt installation directory and set the variable Qt5Gui_PRIVATE_INCLUDE_DIRS to the location were you private headers are found with this below.
set(Qt5Gui_PRIVATE_INCLUDE_DIRS "${_qt5Gui_install_prefix}/include/QtGui/${Qt5Gui_VERSION_STRING}/QtGui" "${_qt5Gui_install_prefix}/include/QtCore/${Qt5Gui_VERSION_STRING}/QtCore")
And note this version QtWebKit (5.212) of is known to have several
bugs, so its best you go for those stable ones.
The Save and run
perl Tools\Scripts\build-webkit --qt --release --only-webkit --no-ninja --cmakeargs="-Thost=x64 -DCMAKE_GENERATOR_PLATFORM=x64 -DCMAKE_PREFIX_PATH=c:\Qt\Qt5.6.0\5.6\msvc2015" -G \"Visual Studio 14 2015 Win64\" --prefix=E:\Qt-5.10.1\QtWebKitBin -v
As you wanted, that should be able to run as expected.

Related

How to use Apache Arrow to write files in Parquet format on Windows using C++?

I'm trying to write Parquet files on Windows using C++.
I followed the instructions I found here and chose the "Using conda-forge for build dependencies" and "Building using Visual Studio (MSVC) Solution Files" approaches.
In contrast to the article on the page mentioned before, my calls to cmake look like this:
cmake .. -G "Visual Studio 16 2019" -A x64 ^
-DARROW_BUILD_TESTS=OFF ^
-DARROW_PARQUET=ON ^
-DARROW_BUILD_SHARED=OFF ^
-DARROW_BUILD_STATIC=ON ^
-DARROW_DEPENDENCY_SOURCE=AUTO
cmake --build . --config Release
I want to use Parquet/Arrow as a static library, so I set -DARROW_BUILD_SHARED=OFF and -DARROW_BUILD_STATIC=ON.
In the "build" folder created after running cmake, I built the Parquet and Arrow INSTALL projects (build\src\parquet\INSTALL.vxcproj, build\src\arrow\INSTALL.vxcproj) with Visual Studio 2019. As a result, a folder structure was created under C:\Program Files\arrow\lib including arrow_static.lib and parquet_static.lib.
Under C:\Program Files\arrow\include\arrow respectively \parquet all related header files can be found.
I then set up a new C++ project (Release Build | x64) in Visual Studio referencing the previously build static libs and including directories.
In the project settings under "C/C++->Preprocessor->Preprocessor Definitions" I added PARQUET_STATIC and ARROW_STATIC.
For a first test, I use the "reader_writer" example from the apache arrow GitHub repo:
Now, if I build the reader_writer example, I receive multiple linking errors (LNK2001) like the following example:
Error LNK2001 unresolved external symbol "public: virtual char const * __cdecl apache::thrift::transport::TTransportException::what(void)const " (?what#TTransportException#transport#thrift#apache##UEBAPEBDXZ) ReaderWriterDemo D:\..\ReaderWriterDemo\parquet_static.lib(column_writer.obj)
All errors have in common that they refer to as "thrift" at some point.
I was under the impression that when using "conda-forge for build dependencies" (see first link above), that all required dependencies would be available/somehow integrated into the solutions built by CMake?!
When running "cmake .. -G "Visual Studio 16 2019" -A x64" I can see the following in the log output though:
-- Checking for module 'thrift'
-- Found thrift, version 0.15.0
-- Found Thrift: D:/Programs/Miniconda3/envs/arrow-dev/Library/lib/thriftmd.lib (found suitable version "0.15.0", minimum required is "0.11.0")
My attempts to build the thrift library separately by using the resources found here weren't successful; information regarding Windows seems to be incomplete/outdated.
I assume that it should be possible to set up the Arrow/Parquet libs only by using resources from https://github.com/apache/arrow/.
Perhaps some of you have already gone through the same process and can give me a hint as to where else I may have missed something.

OpenSpliceConfig.cmake or opensplice-config.cmake not found while building dds-tutorial-cpp-ex

I am trying to learn dds. According to the tutorial, Appendix 1 suggests to look at examples on provided in github called dds-examples-cpp-ex.
The simple commands to build this examples according to readme is cmake . && make
I execute the command
cmake . && make
from the cmake directory of this folder after cloning it on my local machine
I get the following error:
CMake Error at CMakeLists.txt:28 (FIND_PACKAGE):
By not providing "FindOpenSplice.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"OpenSplice", but CMake did not find one.
Could not find a package configuration file provided by "OpenSplice" with
any of the following names:
OpenSpliceConfig.cmake
opensplice-config.cmake
Add the installation prefix of "OpenSplice" to CMAKE_PREFIX_PATH or set
"OpenSplice_DIR" to a directory containing one of the above files. If
"OpenSplice" provides a separate development package or SDK, be sure it has
been installed.
-- Configuring incomplete, errors occurred!
See also "/home/gajendra/Documents/AnokhiDocs/DDS/dds-tutorial-cpp-ex/cmake/CMakeFiles/CMakeOutput.log".
I tried to locate OpenSpliceConfig.cmake && opensplice-config.cmake on my system but I did not get any result.
My question is how can I correct the paths or fix this error?
I have OpenSplice running on my local machine and I have executed other examples directly from $OSPL_HOME/opensplice/dcps/Tutorial. and they work fine.
I also tried to build ch1. I edited the second line in ch1/CMakeLists.txt from
set(CMAKE_MODULE_PATH ../cmake)
to
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
so that it can find cmake folder in the root directory where CMakeLists.txt resides.
I run into the same problem when I execute the following:
cd ch1 && mkdir build && cd build && cmake ..
CMake Error at /home/gajendra/Documents/AnokhiDocs/DDS/dds-tutorial-cpp-ex/cmake/FindOpenSplice.cmake:72 (MESSAGE):Could not find OpenSplice DDS
Call Stack (most recent call first):
CMakeLists.txt:8 (find_package)
I had the same problem on Ubuntu 20.04 and OpenSplice 6.10.3p1
I just sourced the release.com file in the installation directory, then went to each "ch" folder as suggested by #Tsyvarev and ran cmake . && make from there.
CMake ran successfully afterwards.

Could not find a package configuration file provided by "boost_atomic"

I am compiling C/C++ to wasm with emscripten. And need boost library as well. Pretty new to emscripten and wasm
After installing emscripten and boost. I ran the following command
emconfigure cmake -DBoost_DEBUG=1
-Dboost_headers_DIR=../boost_1_71_0/build/lib/cmake/boost_headers-1.71.0
-DBoost_DIR=../boost_1_71_0/build/lib/cmake/Boost-1.71.0 -Dboost_program_options_DIR=../boost_1_71_0/build/lib/cmake/boost_program_options-1.71.0
-Dboost_system_DIR=../boost_1_71_0/build/lib/cmake/boost_system-1.71.0 -Dboost_thread_DIR=../boost_1_71_0/build/lib/cmake/boost_thread-1.71.0 -Dboost_unit_test_framework_DIR=../boost_1_71_0/build/lib/cmake/boost_unit_test_framework-1.71.0
-DZLIB_INCLUDE_DIR=${HOME}/.emscripten_ports/zlib/zlib-version_1 -DZLIB_LIBRARY=${HOME}/.emscripten_cache/asmjs -DBUILD_TESTING=0 -DBoost_USE_STATIC_LIBS=ON -DBoost_USE_STATIC_RUNTIME=ON -DBUILD_EXEC=OFF -DBUILD_TESTING=OFF ..
I get the following error
CMake Error at /home/../boost_1_71_0/build/lib/cmake/boost_thread-1.71.0/boost_thread-config.cmake:91 (find_package):
Could not find a package configuration file provided by "boost_atomic"
(requested version 1.71.0) with any of the following names:
boost_atomicConfig.cmake
boost_atomic-config.cmake
Add the installation prefix of "boost_atomic" to CMAKE_PREFIX_PATH or set
"boost_atomic_DIR" to a directory containing one of the above files. If
"boost_atomic" provides a separate development package or SDK, be sure it
has been installed.
The boost_atomic-config.cmake is at /home/../boost_1_71_0/build/lib/cmake/boost_atomic-1.71.0/boost_atomic-config.cmake. How should I set the boost_atomic_DIR path to this file, as required above?
I added a flag -Dboost_atomic_DIR=/path/to/.cmake/file in the above command and it worked.

Using GPGME in Debian for C++ Application

I would like to use GPGME for key generation and encryption in my C++ application. However, while trying to get started, I got stuck with a problems:
I dowloaded the dev package for my debian system. Now I would like to tell my compiler (gcc in Qt Creator) where to find the library with cmake using the tool mentioned in the documentation. But I don't know how to add gpgme-config --cflags --libs to my compiler flags. This didn't work:
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} `gpgme-config --cflags --libs` ")
When I try to build the app the compiler can't find gpgme-config:
c++: error: $(gpgme-config: File or Directory not found
c++: error: unrecognized command line option ‘--cflags’
c++: error: unrecognized command line option ‘--libs)’
Anyway executing gpgme-config --cflags --libs on command line DOES give me a result:
-L/usr/lib/x86_64-linux-gnu -lgpgme -lassuan -lgpg-error
I know the documentation also mentions Automake and libtool to make this process easier. But I neither used Automake or libtool before.
UPDATE:
I also tried to use a FindGpgme.cmake file for GPGME. But the first file I used required several other cmake files, which I also downloaded. I put them in the same directory as FindGpgme.cmake. The main cmake file (FindGpgme.cmake) was found, but MacroEnsureVersion and MacroBoolTo01 not. My change to my CMakeLists.txt was the following:
include(cmake_modules/FindGpgme.cmake)
find_package(Gpgme)
I tried relative and absolute path to the other files in FindGpgme.cmake. Same problem - cmake can't find them. My second try was with the file I found on gitweb. The error was:
CMake Error at cmake_modules/FindGpgme.cmake:376 (set_package_properties):
Unknown CMake command "set_package_properties".
Call Stack (most recent call first):
CMakeLists.txt:7 (include)
I have absolutely no glue how to fix that set_package_properties problem.
UPDATE 2
I added
include(FeatureSummary)
to my CMakeLists.txt as proposed by kfunk. Now I get the following error:
CMake Warning at CMakeLists.txt:9 (find_package): By not providing
"FindGpgme.cmake" in CMAKE_MODULE_PATH this project has asked CMake
to find a package configuration file provided by "Gpgme", but CMake
did not find one.
Could not find a package configuration file provided by "Gpgme" with
any of the following names:
GpgmeConfig.cmake
gpgme-config.cmake
Add the installation prefix of "Gpgme" to CMAKE_PREFIX_PATH or set
"Gpgme_DIR" to a directory containing one of the above files. If
"Gpgme" provides a separate development package or SDK, be sure it
has been installed.
Even the message description seams pretty detailed I don't know how to add the FindGpgme.cmake to CMAKE_MODULE_PATH or how to add the requested prefix to CMAKE_PREFIX_PATH. The dev package however is definitely installed (using package manager)
I'd suggest to use a proper CMake find script to look up the GPGME installation:
Example here:
https://quickgit.kde.org/?p=kwallet.git&a=blob&h=7a092104ba0604b0606c4662750b8b32c5c3e2c6&f=cmake%2FFindGpgme.cmake&o=plain
Then something like this in your CMake code (untested):
find_package(Gpgme)
include_directories(${GPGME_INCLUDES})
target_link_libraries(YOURTARGET ${GPGME_VANILLA_LIBRARIES)

Adding LLVM to my Cmake Project: Why are there hardcoded paths in LLVM's Cmake file?

I'm using LLVM/Clang in my C++ project. I can build and run everything fine with a Makefile.
I'm now trying to move to Cmake and I can't get things to work. Let me explain what I've done.
I'm following this tutorial:
http://llvm.org/docs/CMake.html#embedding
A relevant snippet from that webpage is:
From LLVM 3.5 onwards both the CMake and autoconf/Makefile build
systems export LLVM libraries as importable CMake targets.
Great! I'll go download LLVM 3.5 and I should be good to go. I went to the download page:
http://llvm.org/releases/download.html
and downloaded the pre-built binaries for Clang for Ubuntu 14.04 Linux.
Then, I added the following to my CMakeLists.txt file:
find_path (LLVM_DIR LLVM-Config.cmake
/home/dev/Downloads/clang+llvm-3.5.0-x86_64-linux-gnu/share/llvm/cmake
)
message(STATUS "LLVM_DIR = ${LLVM_DIR}")
find_package(LLVM REQUIRED CONFIG)
(This is the same as the tutorial, except I set LLVM_DIR since it is currently in a non-standard location.)
When I run cmake, I get the following error:
[dev#beauty:/path/to/project/build (develop)] $ cmake ..
-- LLVM_DIR = /home/dev/Downloads/clang+llvm-3.5.0-x86_64-linux-gnu/share/llvm/cmake
CMake Error at /home/dev/Downloads/clang+llvm-3.5.0-x86_64-linux-gnu/share/llvm/cmake/LLVMConfig.cmake:50 (include):
include could not find load file:
/home/ben/development/llvm/3.5/final/Phase3/Release/llvmCore-3.5.0-final.install/share/llvm/cmake/LLVMExports.cmake
Call Stack (most recent call first):
CMakeLists.txt:14 (find_package)
CMake Error at /home/dev/Downloads/clang+llvm-3.5.0-x86_64-linux-gnu/share/llvm/cmake/LLVMConfig.cmake:53 (include):
include could not find load file:
/home/ben/development/llvm/3.5/final/Phase3/Release/llvmCore-3.5.0-final.install/share/llvm/cmake/LLVM-Config.cmake
Call Stack (most recent call first):
CMakeLists.txt:14 (find_package)
So Cmake seems to be finding LLVM's Cmake file, but Cmake is complaining about some path starting with /home/ben/.
Indeed, it appears that LLVM's LLVMConfig.cmake file has some absolute paths in it that are not relevant for my machine. For example:
[dev#beauty:~/Downloads/clang+llvm-3.5.0-x86_64-linux-gnu ] $ head ./share/llvm/cmake/LLVMConfig.cmake
# This file provides information and services to the final user.
set(LLVM_INSTALL_PREFIX "/home/ben/development/llvm/3.5/final/Phase3/Release/llvmCore-3.5.0-final.install")
set(LLVM_VERSION_MAJOR 3)
set(LLVM_VERSION_MINOR 5)
set(LLVM_VERSION_PATCH 0)
set(LLVM_PACKAGE_VERSION 3.5.0)
set(LLVM_COMMON_DEPENDS )
Who's ben and what's he doing in this file? He shows up in a few more places:
[dev#beauty:~/Downloads/clang+llvm-3.5.0-x86_64-linux-gnu ] $ grep ben ./share/llvm/cmake/LLVMConfig.cmake
set(LLVM_INSTALL_PREFIX "/home/ben/development/llvm/3.5/final/Phase3/Release/llvmCore-3.5.0-final.install")
set(LLVM_INCLUDE_DIRS "/home/ben/development/llvm/3.5/final/Phase3/Release/llvmCore-3.5.0-final.install/include")
set(LLVM_LIBRARY_DIRS "/home/ben/development/llvm/3.5/final/Phase3/Release/llvmCore-3.5.0-final.install/lib")
set(LLVM_CMAKE_DIR "/home/ben/development/llvm/3.5/final/Phase3/Release/llvmCore-3.5.0-final.install/share/llvm/cmake")
set(LLVM_TOOLS_BINARY_DIR "/home/ben/development/llvm/3.5/final/Phase3/Release/llvmCore-3.5.0-final.install/bin")
Needless to say, those paths do not exist on my machine. I'm confused as to why these files have these paths in them? Am I supposed to run a tool or something to change these paths for my machine? Or do I need to change them all manually?
EDIT: Out of curiosity, I manually changed all those paths to point to paths on my machine:
[dev#beauty:~/Downloads/clang+llvm-3.5.0-x86_64-linux-gnu/share/llvm/cmake ] $ sed -i -e's/.home.ben.development.llvm.3.5.final.Phase3.Release.llvmCore-3.5.0-final.install/\/home\/dev\/Downloads\/clang+llvm-3.5.0-x86_64-linux-gnu/g' *
After that, Cmake no longer complained and my build proceeded.
I'd still like to know why I needed to do that.
Sounds like a LLVM bug. Feel free to enter it: http://llvm.org/bugs
We just have to build with 'Ninja' instead of 'Unix Makefiles' and that's all