Building Qt6 project - QMAKE_CXX.COMPILER_MACROS not defined - qt

I'm building a Qt6 project using the following command
~/Qt/6.3.1/gcc_64/bin/qmake -o ~/nidb/bin/smtp/Makefile ~/nidb/src/smtp/SMTPEmail.pro -spec linux-g++
And it generates this error...
~/Qt/6.3.1/gcc_64/mkspecs/features/toolchain.prf:76: Variable QMAKE_CXX.COMPILER_MACROS is not defined.
This used to work fine on my Rocky Linux 8 machine, but now it's not working. I ran a yum update at some point in the last few weeks, but that's the only thing I can think of that changed.
What are some other reasons it might have stopped working?

Related

Building open source project(Mumble) in Qt via CMake on Windows

I'm attempting to build Mumble on my Windows 10 PC in Qt, and I'm running into some issues (I think I'm just a bit lost on some of the Qt, CMake, and build lingo). I've installed all of the required Qt packages through VCPKG, and I've built the program with almost no issues through the "x64 Native Tools Command Prompt for VS 2019"...
Here is the build documentation that Mumble provides.
I believe what's got me particularly confused is the CMake process. After getting the necessary packages installed, the Mumble instructions have you run the following cmake -G command.
cmake -G "NMake Makefiles" "-DVCPKG_TARGET_TRIPLET=x64-windows-static-md" "-Dstatic=ON" "-DCMAKE_TOOLCHAIN_FILE=D:\Users\Skewb\Documents\repos\vcpkg\scripts\buildsystems\vcpkg.cmake" "-DIce_HOME=D:\Users\Skewb\Documents\repos\vcpkg\installed\x64-windows-static-md" "-DCMAKE_BUILD_TYPE=Release" ..
Followed by the actual "build" command:
cmake --build .
From what I can tell, there's no place for me to input the cmake -G command in the "Build Settings" page. Here's where I've attempted to input it. I've been through the errors below, but I think my lack of understanding of cmake --build and cmake -G has made looking at these files unnecessary.
If I've somehow gotten that correct (I haven't), here's the error I'm getting. It's unable to find the "Ice" directory, but I've specified it in that command.
-- Qt5 component found: Widgets | Version: 5.15.2
CMake Error at cmake/pkg-utils.cmake:87 (message):
Ice component not found: Ice
Call Stack (most recent call first):
src/murmur/CMakeLists.txt:267 (find_pkg)
-- Configuring incomplete, errors occurred!
See also "C:/Users/skewb/AppData/Local/Temp/QtCreator-CfECuA/qtc-cmake-Kjqhpyja/CMakeFiles/CMakeOutput.log".
See also "C:/Users/skewb/AppData/Local/Temp/QtCreator-CfECuA/qtc-cmake-Kjqhpyja/CMakeFiles/CMakeError.log".
CMake process exited with exit code 1.
Elapsed time: 00:55.
I've also gone through these instructions and found the "CMake generator" option in the "Kits" settings, but I don't see anywhere to change the options you feed it:
I think I'm conflating a bunch of terms and their uses in the Mumble documentation vs. Qt including, but not limited to:
Build
Make
Run
Clean
Any help understanding this issue would be greatly appreciated.

Project ERROR: Could not find feature when running qmake on any qt module

i am following guide written in here: https://wiki.qt.io/RaspberryPi2EGLFS
everythng runs smooth (needed to add fonts) - I can run and debug an application on my device from my pc.
But if I try to install any module (qtdeclarative, qt3d, qtquickcontrols, qtquickcontrols2) it just tells me no for a lack of some feature.
For examplee:
git clone git://code.qt.io/qt/qtdeclarative.git -b 5.9.0
cd qtdeclarative
~/raspi/qt5/bin/qmake -r
Gives me lots of positive code, but ends with:
Reading /path/to/raspi/qtdeclarative/src/quick/quick.pro
Project ERROR: Could not find feature qml-network.
Similar thing applies for the rest.
Could anyone tell me what to do?
edit
to make it worse same thing happens on 5.9.2 but 5.7 isn't compatible with rpi3
Try to do
~/raspi/qt5/bin/qmake
without the -r option. It worked for me.

Cannot mix incompatible Qt library (version 0x50501) with this library (version 0x50201)

I have installed Shadowsocks-Qt5 within the code sudo apt-get install shadowsocks-qt5 in terminal, and then I can find the launch icon by searching, but it won't open when I click the icon. Then I tried to use terminal to open it, but the error comes out as below:
~ ss-qt5
Cannot mix incompatible Qt library (version 0x50501) with this library (version 0x50201)
[1] 8875 abort (core dumped) ss-qt5
I searched many answers but no one work. I think the key may be the default Qt library, but I don't know how to set default Qt library, the system on my computer is Ubuntu 14.04 LTS.
How to solve this problem?
I just had this error when attempting to run Qt Creator after doing a system update. For me, I was attempting to run Qt Creator 4.10.0-rc1 (based on Qt 5.13.1) that I had manually installed to ~/Qt along with Qt 5.13.0, and my system has Qt 5.12.2 installed.
I was getting the following error:
Cannot mix incompatible Qt library (version 0x50c02) with this library (version 0x50d00)
Doing an strace when running qtcreator.sh revealed that it was attempting to load plugins from the system directory. I finally discovered the culprit was the environment variable QT_PLUGIN_PATH was set (in my case to /usr/lib64/qt5/plugins:/usr/lib64/qt5/plugins/kcms).
After unsetting this variable, Qt Creator started up and worked.
After so many months of trying to fix this issue, this helped me.
sudo apt install qt5-style-plugins.
I was facing a similar issue, and even after 4 hours of debugging, I got nowhere. Finally, I found the following way to keep separate Qt versions, posting here so that other people find it.
Suppose you installed Qt in ${QtRoot}, extend the PATH and LD_LIBRARY_PATH:
export PATH=${QtRoot}/bin:${PATH}
export LD_LIBRARY_PATH=${QtRoot}/lib:${LD_LIBRARY_PATH}
You can make a wrapper function / script to manage separate Qt installations like this:
QtVersion=5.12.8
QtRoot="/scratch/Qt/${QtVersion}/gcc_64"
export PATH=${QtRoot}/bin:${PATH}
export LD_LIBRARY_PATH=${QtRoot}/lib:${LD_LIBRARY_PATH}
After running this your application will likely run fine.

Cannot cmake kde-connect

I am trying to install kde-connect following this.
Although my kubuntu version is 14.04, I wanted to compile them so that I can have the latest version. But when I followed the instructions to compile, i get the following error.
-- Found Qt-Version 5.2.1 (using /usr/bin/qmake)
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
QT_QT_INCLUDE_DIR
used as include directory in directory /home/vinaychandra/Downloads/t/CMakeFiles/CMakeTmp
CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Error at /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:1311 (message):
Unable to compile a basic Qt application. Qt has not been found correctly.
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindKDE4.cmake:95 (find_package)
CMakeLists.txt:7 (find_package)
Please point out how to correct this.
I have tried giving -DQT_QT_INCLUDE_DIR=/usr/share/qt4/
then it tells that You must build your code with position independent code if Qt was built with -reduce-relocations.
Your cmake by default uses a different QT version.
So, you must explicitly tell him which version of QT he have to use for this job.
This one
-DQT_QT_INCLUDE_DIR=/usr/share/qt4/
Is wrong because you mustn't give QT position explicitly.
All you need is to use the right qmake.
So, give'em this flag and you'll be happy!
-DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4
Since most of kde applications are not ported to Qt5, you need Qt4.x for building kdeconnect(don't know x, mine is 4.8.6).
Also Qt4 installer is not available (I think !), so you have to build it also from source. Building Qt4 is quite easy, just download the source and run the usual commands.
After building it, it qmake name will be qmake-qt4 in /usr/bin.
So for building kdeconnect, first run its cmake, then a Cmaketextcache.txt file will form.
In that change the path of qmake (i.e somewhere written /usr/bin/qmake to /usr/bin/qmake-qt4) and also the path of qt include dir to (I think /usr/include/qt5 to /usr/include/qt4), and run the cmake again.
If some packages are missing, then you have to install it.
But with the above changes, you will get a make file to install it.
Unfortunately, the cited documentation is lagging behind the current state of kdeconnect. I ran into similar problems but I managed to solve them by installing the following required packages from the Kubuntu repositories:
sshfs
libfakekey-dev
libxtst-dev
libqca2-dev
libqjson-dev
I trust these are all of them. I installed kdeconnect from the latest git commit and it seems to run fine.
This answer comes a bit late, but this is the first Google search result for the question. In systems with qtchooser (Kubuntu, Ubuntu at least), this can be fixed by running first:
export QT_SELECT=qt4
This makes all of the Qt build tools to default to the Qt4 version instead of Qt5. You can check which Qt version is active by running:
qmake --version
Try kde connect install on ubuntu: https://fazlerabbi37.github.io/blogs/install_kde_connect_in_ubuntu_18.04.html
(in 18.04 & 19.04 it works with simple sudo apt install kdeconnect
Install kde connect on android device (google play store is where I installed from)
Invoke kde connect from desktop
Invoke kde connect from android and search device.
Your ubuntu will be found / initiating a search from desktop results in android phone pulled up for pairing
Accept pairing request
Provide access to folders
Try clicking on a video/image file for transfer
I could see the new file transferring in /Downloads folder of desktop
allowing/disallowing desktop to access sms, notifications etc are now a choice
Note: Pl treat this with pinch of salt. This appears very simple, effective for a main reason it worked for me in no time.

How long does it take to build MacVim from source?

I am trying to install MacVim in my Macbook Pro from Homebrew. However it "got stuck" at
xcodebuild -project MacVim/Macvim.xcodeproj ARCHS="x86_64" ONLY_ACTIVE_ARCHS="NO"
for nearly 6 hours. Last time I remember building from source that took me so long was the Open Office.
By the way. I am running Lion. I know there is no stable version of MacVim for Lion yet but I guess this shouldn't be a problem building it. I have Xcode 4 installed with Command Line Tools.
Am I missing something?
Thanks in Advance.
Problem solved. What happened is that I installed the command line tools for xcode but its path was not properly configured. For example, to compile MacVim it required xcodebuild to run. The only reference for xcodebuild I found in my system was in /usr/bin so I set the path to that location. Even though xcodebuild was being found by make, it would get stuck forever and not returning any erros (weird). I tried to build other application purely based on gcc and it got stuck with no errors too. Finaly I found the correct path for command-line tools for Xcode 4.3. The code to set it up is:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
source: http://jeffreyearly.com/2012/02/28/broken-command-line-tools-clt-in-xcode-4-3/

Resources