【发布时间】:2016-03-16 11:11:35
【问题描述】:
我遇到了上述错误的问题。 在 m 代码中是实现的 HMAC。 我尝试通过此链接解决问题:Here
但它只是不起作用,所以我希望你能帮助我。我真的坚持这一点并使用 QMAKE_CXXFLAGS 但没有得到积极的解决方案。
这是.pro:
QT += core gui webkit network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = csui
TEMPLATE = app
#QMAKE_CFLAGS_RELEASE += -lssl -lcrypto
#QMAKE_CFLAGS_RELEASE += -lcrypto
target.path = /home/msw
INSTALLS += target
SOURCES += main.cpp\
mainwindow.cpp \
qcolpushbutton.cpp \
librfid/mifare.cpp \
librfid/list.cpp \
librfid/brp.cpp \
qrfid.cpp \
qscaledlabel.cpp \
statelogic.cpp \
qcsnp.cpp \
qchargepoint.cpp \
qi2cnode.cpp \
libhotp-tan.cpp
HEADERS += mainwindow.h \
qcolpushbutton.h \
debug.h \
config.h \
librfid/mifare.h \
librfid/list.h \
librfid/brp.h \
qrfid.h \
qscaledlabel.h \
statelogic.h \
qcsnp.h \
qchargepoint.h \
qi2cnode.h \
libhotp-tan.h
FORMS += mainwindow.ui
RESOURCES += \
res/res.qrc
以及来自 Makefile 的链接
CFLAGS = -pipe -isystem /home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/include -isystem /home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/usr/include -O2 -Wall -W -D_REENTRANT $(DEFINES)
CXXFLAGS = -pipe -isystem /home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/include -isystem /home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/usr/include -O2 -Wall -W -D_REENTRANT $(DEFINES)
13:45:58: Führe Schritte für Projekt csui aus...
13:45:59: Starte "/opt/qt-4.8.3e-armhf/sysroot-cross/bin/qmake" '/home/msw/Arbeitsfläche/Experimentelles Programm/csui.pro' -r -spec /opt/qt-4.8.3e-armhf/sysroot-target/usr/mkspecs/qws/linux-ptx-g++
13:45:59: Der Prozess "/opt/qt-4.8.3e-armhf/sysroot-cross/bin/qmake" wurde normal beendet.
13:45:59: Starte "/usr/bin/make" -w
make: Entering directory `/home/msw/Arbeitsfläche/Experimentelles Programm'
arm-1136jfs-linux-gnueabihf-g++ -L/home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/lib -L/home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/usr/lib -Wl,-rpath-link -Wl,/home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/lib -Wl,-rpath-link -Wl,/home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/usr/lib -Wl,-O1 -o csui main.o mainwindow.o qcolpushbutton.o mifare.o list.o brp.o qrfid.o qscaledlabel.o statelogic.o qcsnp.o qchargepoint.o qi2cnode.o libhotp-tan.o moc_mainwindow.o moc_qcolpushbutton.o moc_qrfid.o moc_qscaledlabel.o moc_statelogic.o moc_qcsnp.o moc_qchargepoint.o moc_qi2cnode.o qrc_res.o -L/home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/lib -L/home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/usr/lib -lQtWebKit -lQtGui -L/home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/usr/lib -L/home/msw/crossdev/OSELAS.BSP-RaspberryPi/platform-RaspberryPi/sysroot-target/lib -lQtNetwork -lQtCore -lpthread
make: Leaving directory `/home/msw/Arbeitsfläche/Experimentelles Programm'
libhotp-tan.o: In function `hotpa(unsigned char const*, unsigned char const*, char*, unsigned int, unsigned char const*, unsigned int)':
libhotp-tan.cpp:(.text+0x74): undefined reference to `EVP_sha1'
libhotp-tan.cpp:(.text+0xb4): undefined reference to `HMAC'
collect2: error: ld returned 1 exit status
make: *** [csui] Error 1
13:46:01: Der Prozess "/usr/bin/make" wurde mit dem Rückgabewert 2 beendet.
Fehler beim Erstellen/Deployment des Projekts csui(Ziel: Embedded Linux)
Bei der Ausführung von Schritt 'Make'
谢谢!!
【问题讨论】:
-
要获得有关失败链接的帮助,您至少需要逐字发布失败的链接器命令行和随之而来的错误。
-
我插入了 pro 和 makefile 的某些部分,希望它会有所帮助。谢谢!
-
失败的链接器命令行是
g++\gcc命令行,它在执行时会失败,后面是链接错误消息。它不在生成文件中。当构建失败时,您会在构建输出中看到这些。从构建输出中复制失败的命令行和错误消息并将它们粘贴到问题的正文中,缩进 4 个空格。 -
你是这个意思吗?...真的非常感谢
标签: c++ qt undefined qmake hmac