From: "demon.han@aliyun.com" <demon.han@aliyun.com>
To: xenomai <xenomai@xenomai.org>
Subject: Re: Qt application on Xenomai
Date: Wed, 3 Apr 2019 20:10:33 +0800 [thread overview]
Message-ID: <2019040320103347639410@aliyun.com> (raw)
Hi, Stéphane
I want to compile RT-task with QT-5.8-linux.
The application build well,but the app break when I run it.
Here are some mesg:
[ 1856.686076] xenomaipro[22438]: segfault at 7ffea0117ff8 ip 00007fef26a3ae17 sp 00007ffea0118000 error 6 in libcobalt.so.2.0.0[7fef26a2f000+1f000]
I can find the program break when it runs : rt_task_create().
How can I fix this? I think the .pro is something missing, but can you fix it please? Many thanks!
My platform is ubuntu16 、linux4.4 and xenoam 3.0.5,using QT 5.8.
My qt project:
main.c:
#include <QCoreApplication> #include <stdlib.h> #include <math.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <sched.h> #include <time.h> #include <unistd.h> #include <signal.h> #include <alchemy/task.h> #include <alchemy/timer.h> RT_TASK task; static void latency(void *cookie) { RTIME start_ns; int ret; start_ns = rt_timer_read() + 1000000; ret = rt_task_set_periodic(NULL, start_ns, 10000000); if (ret) { printf("rt_task_set_periodic error\n"); return; } while(1){ rt_task_wait_period(NULL); printf("0\n"); } } int main(int argc, char *argv[]) { int ret; QCoreApplication a(argc, argv); ret = rt_task_create(&task, "task_name", 0, 99, 0); //break here!!! if (ret) { printf("rt_task_create error\n"); return 0; }
ret = rt_task_start(&task, &latency, NULL); if (ret) { printf("rt_task_start error\n"); return 0; } return a.exec(); }
and .pro is:
QT += core
QT -= gui
CONFIG += c++11
TARGET = xenomaipro
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
#LIBS += -L/usr/xenomai/lib -lalchemy -lanalogy -lcobalt -lcopperplate -lmodechk -lpsos -lsmokey -ltrank -lvxworks -lpthread -lrt
INCLUDEPATH += /usr/xenomai/include
INCLUDEPATH += /usr/xenomai/include/cobalt
unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lalchemy
INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libalchemy.a
unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lcobalt
INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libcobalt.a
unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lanalogy
INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libanalogy.a
unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lcopperplate
INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libcopperplate.a
unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lmodechk
INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libmodechk.a
unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lpsos
INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libpsos.a
unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lsmokey
INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libsmokey.a
unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -ltrank
INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libtrank.a
unix:!macx: LIBS += -L$$PWD/../../../../usr/xenomai/lib/ -lvxworks
INCLUDEPATH += $$PWD/../../../../usr/xenomai/include
DEPENDPATH += $$PWD/../../../../usr/xenomai/include
unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../usr/xenomai/lib/libvxworks.a
demon.han@aliyun.com
next reply other threads:[~2019-04-03 12:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-03 12:10 demon.han [this message]
2019-04-04 0:39 ` Qt application on Xenomai Alec Ari
-- strict thread matches above, loose matches on Subject: below --
2019-04-04 1:50 demon.han
2019-03-01 8:40 Sumitabh Ghosh
2019-03-01 12:32 ` Henning Schild
2019-03-02 5:57 ` Sumitabh Ghosh
2019-03-04 7:55 ` Stéphane Ancelot
2019-03-04 8:38 ` C Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2019040320103347639410@aliyun.com \
--to=demon.han@aliyun.com \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.