您尚未登录。

楼主 #1 2019-07-20 11:16:06

pqfeng
会员
注册时间: 2018-08-18
已发帖子: 129
积分: 129

为什么它始终报找不到头文件,明明我有说明搜索路径,变量有定义。

Creating qmake. Please wait...
make: Nothing to be done for 'first'.
floatmath auto-detection... ()
/opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -O2 -march=armv7-a -lts  -I../../../mkspecs/arm-linux-gnueabihf -I. -o floatmath.o floatmath.cpp
/opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++  -o floatmath floatmath.o     
floatmath enabled.
tslib auto-detection... ()
/opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -O2 -march=armv7-a -lts  -I../../../mkspecs/arm-linux-gnueabihf -I. -o tslib.o tslib.cpp
tslib.cpp:1:19: fatal error: tslib.h: 没有那个文件或目录
#include <tslib.h>
                   ^
compilation terminated.
Makefile:160: recipe for target 'tslib.o' failed
make: *** [tslib.o] Error 1
tslib disabled.

The tslib functionality test failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR and QMAKE_LIBDIR in
#
# qmake configuration for building with arm-linux-gnueabi-g++
#

以上是报错。但我明明有定义。搞不清楚原因。但肯定是有执行的。因为上面

MAKEFILE_GENERATOR      = UNIX
TARGET_PLATFORM         = unix
TEMPLATE                = app
CONFIG                  += qt warn_on release incremental link_prl gdb_dwarf_index
QT                      += core gui
QMAKE_INCREMENTAL_STYLE = sublib

QMAKE_CFLAGS_RELEASE += -O2 -march=armv7-a -lts
QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a -lts

QMAKE_INCDIR=/opt/tslib/include
QMAKE_LIBDIR=/opt/tslib/lib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf
QMAKE_CC                = /opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
QMAKE_CXX               = /opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
QMAKE_LINK              = /opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = /opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = /opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = /opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-objcopy
QMAKE_STRIP             = /opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-strip


load(qt_config)

最近编辑记录 pqfeng (2019-07-20 11:18:24)

离线

#2 2019-07-20 11:23:01

还能这么玩
会员
注册时间: 2019-04-14
已发帖子: 119
积分: 119

Re: 为什么它始终报找不到头文件,明明我有说明搜索路径,变量有定义。

/opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -O2 -march=armv7-a -lts  -I../../../mkspecs/arm-linux-gnueabihf -I. -o tslib.o tslib.cpp


很明显, 这一行并没有 -I/opt/tslib/include, 所以找不到头文件了。

还是配置问题.

离线

楼主 #3 2019-07-20 11:45:11

pqfeng
会员
注册时间: 2018-08-18
已发帖子: 129
积分: 129

Re: 为什么它始终报找不到头文件,明明我有说明搜索路径,变量有定义。

嗯这一行我手动加到编译环境中去了,却又报了其他的问题

You are licensed to use this software under the terms of
the GNU General Public License (GPL) versions 3.
You are also licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.

You have already accepted the terms of the  license.

Creating qmake. Please wait...
make: Nothing to be done for 'first'.
floatmath auto-detection... ()
/opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -O2 -march=armv7-a -I/opt/tslib/include -L/opt/tslib/lib -lts  -I../../../mkspecs/arm-linux-gnueabihf -I. -o floatmath.o floatmath.cpp
/opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++  -o floatmath floatmath.o     
floatmath enabled.
tslib auto-detection... ()
/opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -O2 -march=armv7-a -I/opt/tslib/include -L/opt/tslib/lib -lts  -I../../../mkspecs/arm-linux-gnueabihf -I. -o tslib.o tslib.cpp
/opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++  -o tslib tslib.o     -lts
/opt/arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lts
collect2: error: ld returned 1 exit status
Makefile:91: recipe for target 'tslib' failed
make: *** [tslib] Error 1
tslib disabled.
The tslib functionality test failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR and QMAKE_LIBDIR in
/home/pqfeng/qt-embedded-linux-opensource-src-4.5.2/mkspecs/arm-linux-gnueabihf

离线

#4 2019-07-20 14:35:58

晕哥
管理员
所在地: 微信 whycan_cn
注册时间: 2017-09-06
已发帖子: 9,223
积分: 9197

Re: 为什么它始终报找不到头文件,明明我有说明搜索路径,变量有定义。

/opt/arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++  -o tslib tslib.o     -lts -L/opt/tslib/lib

这里要指定 libts.a 的目录





离线

楼主 #5 2019-07-20 14:40:48

pqfeng
会员
注册时间: 2018-08-18
已发帖子: 129
积分: 129

Re: 为什么它始终报找不到头文件,明明我有说明搜索路径,变量有定义。

这里报的错是因为我原来生成的tslib库居然是X86版的。
吐血。现在直接用以前的库替换了。懒得编译了。

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn