qmake .pro file could not be parsed - qt5

I'm running OS X Mavericks and trying to convert a Qt4 application to Qt5. I've also never compiled the application on this machine before. I have Qt 5.1.* installed on this machine, which parses the file just fine. As soon as I switch over to my Qt 5.2.0 kit and look at the run settings, underneath my "Run configuration" there's a warning: "The .pro file '.pro' could not be parsed.".
I've looked at other solutions on SO and the qt-project website -- none of which have helped. My Qt 5.2.0 kit is a manually-added kit since I installed it using Homebrew.
Here is a screenshot of my settings:
Note that if I run qmake (/usr/local/opt/qt5/bin/qmake) in the project directory, no errors are output.
Here is my .pro file:
QT += core widgets concurrent
TARGET = Up
TEMPLATE = app
CONFIG += c++11
SOURCES += main.cpp\
MainForm.cpp \
AboutForm.cpp \
progressdialog.cpp
HEADERS += MainForm.h \
AboutForm.h \
progressdialog.h
FORMS += MainForm.ui \
AboutForm.ui \
progressdialog.ui
INCLUDEPATH += $$PWD/../FATX/FATX
RESOURCES += \
MainForm.qrc
CONFIG(debug, debug|release) {
macx: LIBS += -L$$PWD/../FATX-BUILD-OSX/debug/ -lFATX
INCLUDEPATH += $$PWD/../FATX-BUILD-OSX/debug
DEPENDPATH += $$PWD/../FATX-BUILD-OSX/debug
macx: PRE_TARGETDEPS += $$PWD/../FATX-BUILD-OSX/debug/libFATX.a
} else {
macx: LIBS += -L$$PWD/../FATX-OSX/release/ -lFATX
INCLUDEPATH += $$PWD/../FATX-BUILD-OSX/release
DEPENDPATH += $$PWD/../FATX-BUILD-OSX/release
macx: PRE_TARGETDEPS += $$PWD/../FATX-OSX/release/libFATX.a
}
cache()

The solution was to update Qt Creator to Qt 3.0.0.

Related

Bitbake LibSocketCAN

I am trying to build libsocketcan into my image. To add libsocketcan In my main application recipe I added IMAGE_INSTALL_append += " libsocketcan ". When debugging my application with Eclipse this works perfectly. When I attempt to bitbake my application I am told
fatal error: libsocketcan.h: No such file or directory
I am not sure where I am missing my dependency.
Makefile.am
AUTOMAKE_OPTIONS = foreign subdir-objects
bin_PROGRAMS = MAIN_Application
MAIN_Application_LDADD = -lsocketcan -lpthread
AM_CPPFLAGS = \
-I$(srcdir)/include \
-I$(srcdir)/include/utilities \
-I$(srcdir)/include/comms
MAIN_Application_SOURCES = \
src/main.c \
src/scheduler.c \
src/utilities/time_conversions.c \
src/utilities/ring_buffer.c \
src/utilities/logger.c \
src/comms/can.c
I believe this is the only file that would make a difference. Has anyone else ever faced this? What else do I need to do to allow my bitbake to find the include?
Edit: recipe as requestes
LICENSE = "MIT"
IMAGE_LINGUAS = " "
# Base image Install
IMAGE_INSTALL = " packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}"
# Configure image base size
IMAGE_ROOTFS_SIZE ?= "4096"
IMAGE_ROOTFS_EXTRA_SPACE_append = "${#bb.utils.contains("DISTRO_FEATURES", "systemd", " + 2048", "", d)}"
# User preferences
inherit core-image
inherit extrausers
# Change root password (note the capital -P)
EXTRA_USERS_PARAMS = "\
usermod -P toor root; \
useradd -P michael -G sudo michael; \
"
# uncomment the line %sudo ALL=(ALL) ALL in /etc/sudoers
modify_sudoers() {
sed 's/# %sudo/%sudo/' < ${IMAGE_ROOTFS}${sysconfdir}/sudoers > ${IMAGE_ROOTFS}${sysconfdir}/sudoers.tmp
mv ${IMAGE_ROOTFS}${sysconfdir}/sudoers.tmp ${IMAGE_ROOTFS}${sysconfdir}/sudoers
}
ROOTFS_POSTPROCESS_COMMAND_append = " modify_sudoers;"
# Dependencies
DEPENDS = " libsocketcan "
# Install necessary libraries
IMAGE_INSTALL_append += " packagegroup-core-ssh-openssh "
IMAGE_INSTALL_append += " can-utils "
IMAGE_INSTALL_append += " libsocketcan"
IMAGE_INSTALL_append += " sudo "
IMAGE_INSTALL_append += " iw wireless-tools wpa-supplicant "
# Install SMG applications
IMAGE_INSTALL_append += " udevrules "
IMAGE_INSTALL_append += " mainapplication "
# Apply kernel customizations
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://kernel_customization.cfg"
# Remove image features
IMAGE_INSTALL_remove += " packagegroup-fsl-optee-imx"
BAD_RECOMMENDATIONS = " udev-hwdb"
#MKUBIFS_ARGS="--leb-size 126976 --min-io-size 2048 --max-leb-cnt 3600"
#UBINIZE_ARGS="--peb-size 128KiB --min-io-size 2048 --sub-page-size 2048"
#IMAGE_FSTYPES += " ubi ubifs"
Edit 2: main application recipe
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "\
file://MAIN_Application \
file://services \
"
inherit autotools systemd
S = "${WORKDIR}/MAIN_Application"
SYSTEMD_SERVICE_${PN} = "MAINapplication.service"
do_install_append () {
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/services/MAINapplication.service ${D}${systemd_system_unitdir}
sed -i -e 's,#BINDIR#,${bindir},g' ${D}${systemd_system_unitdir}/MAINapplication.service
}
libsocketcan provides these packages:
tmp/work/aarch64-poky-linux/libsocketcan/0.0.11-r0/image
└── usr
├── include
│   ├── can_netlink.h
│   └── libsocketcan.h
├── lib
│   ├── libsocketcan.so -> libsocketcan.so.2.3.0
│   ├── libsocketcan.so.2 -> libsocketcan.so.2.3.0
│   ├── libsocketcan.so.2.3.0
│   └── pkgconfig
│   └── libsocketcan.pc
Adding DEPENDS += "libsocketcan" will cause all those files to be populated into your custom layer's working directory.
NOTE
Your recipe seems to do not install your MAIN_Application output binary file. So your recipe should look like:
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "\
file://MAIN_Application \
file://services \
"
inherit autotools systemd
S = "${WORKDIR}/MAIN_Application"
DEPENDS += "libsocketcan"
SYSTEMD_SERVICE_${PN} = "MAINapplication.service"
do_install_append () {
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/services/MAINapplication.service ${D}${systemd_system_unitdir}
sed -i -e 's,#BINDIR#,${bindir},g' ${D}${systemd_system_unitdir}/MAINapplication.service
install -m 0644 ${S}/MAIN_Application ${D}${bindir}
}
Just make sure that MAIN_Application is the right binary name.
IMAGE_INSTALL_append adds package to image.
It has not much to do with build-time dependencies of your application.
What you should add to you app.bb is:
DEPENDS = "libsocketcan"
This is an answer just to help you fix some issues related to your image recipe:
Here are some important comment:
IMAGE_INSTALL
IMAGE_INSTALL = " packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}"
...
inherit core-image
Never and never override IMAGE_INSTALL before core-image, because IMAGE_INSTALL of core-image will not take effect.
Variable assignement
IMAGE_INSTALL_append += " packagegroup-core-ssh-openssh "
IMAGE_INSTALL_append += " can-utils "
IMAGE_INSTALL_append += " libsocketcan"
IMAGE_INSTALL_append += " sudo "
IMAGE_INSTALL_append += " iw wireless-tools wpa-supplicant "
Do not use append with += , use one of them only.
DEPENDS ??
Image recipes are just dedicated to collect recipes and create image rootfs and final image type (wic, ...)
You do not need DEPENDS.
SRC_URI ??
This is also a non-image recipe variable, did it even took effect ?
Move the kernel configuration fragment to your custom virtual/kernel package recipe.
I recommend your image recipe to look like:
LICENSE = "MIT"
IMAGE_LINGUAS = " "
# Configure image base size
IMAGE_ROOTFS_SIZE ?= "4096"
IMAGE_ROOTFS_EXTRA_SPACE_append = "${#bb.utils.contains("DISTRO_FEATURES", "systemd", " + 2048", "", d)}"
# User preferences
inherit core-image extrausers
# Change root password (note the capital -P)
EXTRA_USERS_PARAMS = "\
usermod -P toor root; \
useradd -P michael -G sudo michael; \
"
# uncomment the line %sudo ALL=(ALL) ALL in /etc/sudoers
modify_sudoers() {
sed 's/# %sudo/%sudo/' < ${IMAGE_ROOTFS}${sysconfdir}/sudoers > ${IMAGE_ROOTFS}${sysconfdir}/sudoers.tmp
mv ${IMAGE_ROOTFS}${sysconfdir}/sudoers.tmp ${IMAGE_ROOTFS}${sysconfdir}/sudoers
}
ROOTFS_POSTPROCESS_COMMAND_append = " modify_sudoers;"
# Install necessary libraries
IMAGE_INSTALL_append = " packagegroup-core-ssh-openssh \
can-utils \
libsocketcan \
sudo \
iw wireless-tools wpa-supplicant"
# Install SMG applications
IMAGE_INSTALL_append = " udevrules \
mainapplication"
# Remove image features
IMAGE_INSTALL_remove += " packagegroup-fsl-optee-imx"
BAD_RECOMMENDATIONS = " udev-hwdb"
#MKUBIFS_ARGS="--leb-size 126976 --min-io-size 2048 --max-leb-cnt 3600"
#UBINIZE_ARGS="--peb-size 128KiB --min-io-size 2048 --sub-page-size 2048"
#IMAGE_FSTYPES += " ubi ubifs"

Yocto include cmake project with custom steps

I am trying to include this simple cmake-based project to my image: https://github.com/MatrixOrbital/HTT-Utility
The steps to build in Linux are:
mkdir build
cd build
cmake ..
make
I am trying to reproduce these steps within my Yocto recipe. The generated binary (./build/htt_util) should be installed in /usr/bin.
So far with the help of devtool and some manual tuning I ended up with this recipe:
LICENSE = "MIT & Unknown"
LIC_FILES_CHKSUM = "file://LICENSE;md5=ff75ee274f4c77abeee3db089083fec7 \
file://hidapi/LICENSE.txt;md5=7c3949a631240cb6c31c50f3eb696077"
SRC_URI = "git://github.com/MatrixOrbital/HTT-Utility.git;protocol=https"
SRC_URI += "file://0001-Adding-ctype.patch;"
PATCHTOOL = "git"
# Modify these as desired
PV = "1.0+git${SRCPV}"
SRCREV = "2045d5eacc67b89a02dafe41edfd032179333aee"
S = "${WORKDIR}/git"
inherit cmake
# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = ""
DEPENDS += "udev"
What should I add to my recipe to achieve the goal of generating a binary and installing into /usr/bin?
I have been trying to play with:
do_configure() {
...
}
do_compile() {
...
}
do_install() {
...
}
But so far I did not manage to do anything useful.
Any help would be appreciated.
do_install() {
install -m 0644 mybinary ${D}${bindir}
}
FILES_${PN} = " \
${bindir} \
"

using EXTRA_OECMAKE doesn't have any effect in cmake variable in bitbake recipe

I wanted to add my application in a yocto Image and I used this recipe:
DESCRIPTION = "my application"
SECTION = "examples"
LICENSE = "CLOSED"
PR = "r0"
DEPENDS += "opencv"
SRC_URI = "git://address/to/myApplication.git;protocol=https;tag=v0.1"
inherit pkgconfig cmake
after running bitbake my-application, I faced this error:
fatal error: string: No such file or directory #include <string>
I searched on the internet and I found that I need to pass this variable to my CMake in my recipe:
EXTRA_OECMAKE += "-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON"
but nothing had changed. again I faced the error. then I decided to add the variable to my CMake:
set(CMAKE_NO_SYSTEM_FROM_IMPORTED ON)
after my next try, everything got fine and I didn't face any error.
I opened cmake.bbclass file and I saw these lines in a cmake_do_configure() function:
cmake \
${OECMAKE_GENERATOR_ARGS} \
$oecmake_sitefile \
${OECMAKE_SOURCEPATH} \
-DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
-DCMAKE_INSTALL_BINDIR:PATH=${#os.path.relpath(d.getVar('bindir'), d.getVar('prefix') + '/')} \
-DCMAKE_INSTALL_SBINDIR:PATH=${#os.path.relpath(d.getVar('sbindir'), d.getVar('prefix') + '/')} \
-DCMAKE_INSTALL_LIBEXECDIR:PATH=${#os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix') + '/')} \
-DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
-DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${#os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix') + '/')} \
-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
-DCMAKE_INSTALL_LIBDIR:PATH=${#os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/')} \
-DCMAKE_INSTALL_INCLUDEDIR:PATH=${#os.path.relpath(d.getVar('includedir'), d.getVar('prefix') + '/')} \
-DCMAKE_INSTALL_DATAROOTDIR:PATH=${#os.path.relpath(d.getVar('datadir'), d.getVar('prefix') + '/')} \
-DCMAKE_INSTALL_SO_NO_EXE=0 \
-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
-DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
${EXTRA_OECMAKE} \
-Wno-dev
by default CMAKE_NO_SYSTEM_FROM_IMPORTED is set to 1. therefor, logically I don't need to set this variable in my recipe or cmake.
why EXTRA_OECMAKE and CMake cmake_do_configure() didn't work correctly?
I checked my cmake, and I am sure that I didn't change any CXX flags in it.

Kotlin native interop linker could not find framework

I'm trying to use cocoapods framework in Kotlin Multiplatform project.
So I
added framework to Pods file.
ran pod install.
created .def file
added cinterop config in build.gradle
./gradlew cinteropFirebaseIos runs successfully. It generates .klib so I can see classes in kotlin code.
But when I'm trying to run iOS app build fails with message:
Showing Recent Messages
> Task :app:linkDebugFrameworkIos
ld: framework not found FirebaseDatabase
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
Here is my config in build.gradle
fromPreset(presets.iosX64, 'ios') {
compilations.main {
outputKinds('FRAMEWORK')
cinterops {
firebase {
def proj = "${System.getProperty("user.home")}/Projects/kmpp"
def pods = "${proj}/iosApp/Pods"
defFile "${proj}/app/src/iosMain/c_interop/libfirebase.def"
includeDirs "${pods}/Firebase",
"${pods}/Firebase/CoreOnly/Sources",
"${pods}/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers"
}
}
}
}
here is my .def file:
language = Objective-C
headers = /Users/oleg/Projects/klug/crckalculator/iosApp/Pods/FirebaseCore/Firebase/Core/Public/FIRApp.h /Users/oleg/Projects/klug/crckalculator/iosApp/Pods/FirebaseDatabase/Firebase/Database/Public/FIRDatabase.h /Users/oleg/Projects/klug/crckalculator/iosApp/Pods/FirebaseCore/Firebase/Core/Public/FirebaseCore.h
compilerOpts = -framework FirebaseDatabase
linkerOpts = -framework FirebaseDatabase
How can I figure out what is wrong ? Did I miss something in .def file ? In build.gradle ?
There are two problematic moments here:
full paths to C headers in .def file are usually not desirable, instead passing includeDirs to Firebase installation, like in https://github.com/JetBrains/kotlin-native/blob/c7c566ce0f12221088a8908b6dc8e116c56a931b/samples/gtk/build.gradle#L22 would be helpful
linking problem comes from the similar issue - linker just got no idea where to look for framework libraries, so passing to compilations.main.linkerOpts smth like -F /Users/oleg/Projects/klug/crckalculator/iosApp/Pods/FirebaseCore/ shall help, see for example https://github.com/JetBrains/kotlin-native/blob/c7c566ce0f12221088a8908b6dc8e116c56a931b/samples/videoplayer/build.gradle#L15

QXcbIntegration: Cannot create platform OpenGL context

I've been trying to add Qt5 support to a core-image-sato image using Yocto's Poky Pyro on Raspberry Pi 3.
In my bblayer.conf I added these lines:
BBLAYERS ?= " \
/poky-pyro/meta \
/poky-pyro/meta-poky \
/poky-pyro/meta-yocto-bsp \
/poky-pyro/meta-openembedded/meta-oe \
/poky-pyro/meta-openembedded/meta-multimedia \
/poky-pyro/meta-openembedded/meta-networking \
/poky-pyro/meta-openembedded/meta-perl \
/poky-pyro/meta-openembedded/meta-python \
/poky-pyro/meta-raspberrypi \
/poky-pyro/meta-qt5 \
"
In my local.conf I added these lines:
DISTRO_FEATURES_append = " opengl "
IMAGE_INSTALL_append = " qtbase qtdeclarative qtquickcontrols2 qtmultimedia qttools cinematicexperience "
Bitbake finished building the image successfully, but when I run Qt5_cenimaticExperience on the target I get this error message:
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled.
This is the default configuration of Qtbase and based on what you have:
PACKAGECONFIG_GL ?= "${#bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gl', '', d)}"
PACKAGECONFIG_DEFAULT ?= "dbus udev evdev widgets tools libs freetype tests"
PACKAGECONFIG_SYSTEM ?= "jpeg libpng zlib"
As you can see, we only enabled -opengl desktop; What we need is opengl es2 for embedded system.
To correct this, add this line to your local.conf:
PACKAGECONFIG_append_pn-qtbase = " gles2 "
By the way, this is my qtbase configuration:
PACKAGECONFIG_append_pn-qtbase = " gles2 fontconfig \
gstreamer \
accessibility \
tslib examples \
"