QtUPnP :: CControlPoint выдает недопустимую инструкцию - PullRequest
0 голосов
/ 14 января 2020

Я работаю над некоторым проектом, использующим phyBoard Wega с его SDK с Qt 5.8 . Проект также использует библиотеку QtUPnP , и когда я пытаюсь создать новый объект QtUPnP :: CControlPoint , я получаю недопустимую инструкцию: Illegal instruction screenshot Сама библиотека связана с Основной проект в стиле stati c, вот содержимое файла .pro:

CONFIG += c++11

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Refer to the documentation for the
# deprecated API to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if it uses 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

SOURCES += \
        audiocontentsmodel.cpp \
        audiocontentsrecord.cpp \
        audiodevicerecord.cpp \
        audiodevicesmodel.cpp \
        audioinputrecord.cpp \
        audioinputsmanager.cpp \
        audioinputsmodel.cpp \
        configurationmanager.cpp \
        i2cbusmanager.cpp \
        main.cpp

RESOURCES += qml.qrc

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =

# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

HEADERS += \
    audiocontentsmodel.h \
    audiocontentsrecord.h \
    audiodevicerecord.h \
    audiodevicesmodel.h \
    audioinputrecord.h \
    audioinputsmanager.h \
    audioinputsmodel.h \
    coloreddebug.h \
    configurationkeys.h \
    configurationmanager.h \
    configurationsections.h \
    customtypes.h \
    defaultconfiguration.h \
    i2cbusmanager.h \
    threadnames.h

unix:!macx: LIBS += -L$$PWD/../upnp/ -lqtupnp

INCLUDEPATH += $$PWD/../upnp
DEPENDPATH += $$PWD/../upnp

unix:!macx: PRE_TARGETDEPS += $$PWD/../upnp/libqtupnp.a

Почему я получаю cra sh, когда пытаюсь использовать библиотеку?

ADDENDUM 1: Я также пытался включить библиотеку в качестве динамического c (.so файл), тот же результат.
ADDENDUM 2: Если я перекомпилируйте библиотеку и спроектируйте сам для Desktop Qt (5.14, Ubuntu 19.10), приложение работает нормально.
ADDENDUM 3: Если я проанализирую целевой (окончательный двоичный) файл UserConsole, я получу:

user@bohr:~/Projects/NoordungMkI/Software/UserConsole$ file UserConsole
UserConsole: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=82aaff1b9db2061cbba1c59a3bddd8a6d2d82d80, with debug_info, not stripped  

Должно быть здесь статически связано , потому что библиотека статически связана?

1 Ответ

0 голосов
/ 14 января 2020

Я следовал за кодом с gdb, и библиотека пыталась установить SSL configuration с помощью:

CHTTPServer::CHTTPServer (QHostAddress const & address, quint16 port, QObject* parent) :
             QTcpServer (parent), m_done (false),
             m_httpsBufferSize (4096),
             m_httpsReadDataTimeout (1),
             m_httpsReadDataWaitingRetry (20000)
{
  bool success = listen (address, port);
  if (success)
  {
    m_httpsRequest.setSslConfiguration (QSslConfiguration::defaultConfiguration ());
    connect (this, &CHTTPServer::httpValidReadMessage, this, &CHTTPServer::sendResponse, Qt::QueuedConnection);
    connect (this, &CHTTPServer::streamingReady, this, &CHTTPServer::streamBlock, Qt::QueuedConnection);
    m_done = true;
  }
}

, и я прокомментировал строку с SSL configuration:

CHTTPServer::CHTTPServer (QHostAddress const & address, quint16 port, QObject* parent) :
             QTcpServer (parent), m_done (false),
             m_httpsBufferSize (4096),
             m_httpsReadDataTimeout (1),
             m_httpsReadDataWaitingRetry (20000)
{
  bool success = listen (address, port);
  if (success)
  {
//    m_httpsRequest.setSslConfiguration (QSslConfiguration::defaultConfiguration ());
    connect (this, &CHTTPServer::httpValidReadMessage, this, &CHTTPServer::sendResponse, Qt::QueuedConnection);
    connect (this, &CHTTPServer::streamingReady, this, &CHTTPServer::streamBlock, Qt::QueuedConnection);
    m_done = true;
  }
}

и приложение работает сейчас. Это не лучший способ решения проблемы (я думаю ПЛОХО ), и я сделаю исправление позже.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...