错误:packagename-0.1-r0 do_compile:函数失败:do_compile

时间:2018-02-15 08:59:41

标签: c++ linux yocto

我正在使用yocto linux处理IMX7(Phytec zeta板)。在已经工作的helloworld配方(命名为imx7-2110)中,我添加了一些应用程序源文件(C,C ++,h,hpp),相应地创建了一个make文件和编辑过的.bb文件。在编译时我收到错误,找不到其中一个.hpp文件(PktDriverAbstractionLayer.hpp),虽然它存在于源目录中,并且相应的路径被赋予.bb文件。

可能是什么原因?我在互联网论坛上尝试了一些建议,但没有帮助。

错误详情如下:

[root@localhost build]# bitbake imx7-2110
Loading cache: 100% |###########################################| ETA:        
00:00:00
Loaded 2800 entries from dependency cache.
Parsing recipes: 100% |#########################################| Time: 
00:00:00
Parsing of 2223 .bb files complete (2222 cached, 1 parsed). 2799 targets,    
220 skipped, 5 masked, 0 errors.
WARNING: No bb files matched BBFILE_PATTERN_phytec '^/opt/PHYTEC_BSPs   
/yocto_imx7/sources/meta-phytec/common/'
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.30.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "CentOSLinux-7.4.1708"
TARGET_SYS        = "arm-poky-linux-gnueabi"
MACHINE           = "imx7d-phyboard-zeta-001"
DISTRO            = "fsl-imx-x11"
DISTRO_VERSION    = "4.1.15-2.0.1"
TUNE_FEATURES     = "arm armv7ve vfp  neon        callconvention-hard          
cortexa7"
TARGET_FPU        = "hard"
meta              
meta-yocto        = "HEAD:f5da2a5913319ad6ac2141438ba1aa17576326ab"
meta-oe           
meta-multimedia   = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-fsl-arm      = "HEAD:be78894e4682f111575470fb23e51e6ba523508d"
meta-fsl-arm-extra = "HEAD:3dfb82fc7e703eae9891b3ffda0e9393701f2396"
meta-fsl-demos    = "HEAD:a165068f8a0d1cf29aabe4b4053f28be1c2aa492"
meta-bsp          
meta-sdk          = "HEAD:90399d99af8a2660ebe50b49752e95b210239fd9"
meta-browser      = "HEAD:77736988073a5d90fcff9d0005c8477332ede387"
meta-gnome        
meta-networking   
meta-python       
meta-filesystems  = "HEAD:247b1267bbe95719cd4877d2d3cfbaf2a2f4865a"
meta-qt5          = "HEAD:ccae79be69c5268df3b47e4e14cea0591c39a531"
meta-phytec       
meta-phytec-fsl   = "HEAD:0b1de01225a2ec0debf71eb13be403baa9f4919f"
meta-imx7-2110    = "<unknown>:<unknown>"

NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: imx7-2110-0.1-r0 do_compile: Function failed: do_compile (log file   
is located at /opt/PHYTEC_BSPs/yocto_imx7/build/tmp/work/cortexa7hf-  
neon-poky-linux-gnueabi/imx7-2110/0.1-r0/temp/log.do_compile.7235)
ERROR: Logfile of failure stored in: /opt/PHYTEC_BSPs/yocto_imx7/build
/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/imx7-2110/0.1-r0 
/temp/log.do_compile.7235
Log data follows:
| DEBUG: Executing shell function do_compile
| arm-poky-linux-gnueabi-g++  -march=armv7ve -mfpu=neon  -mfloat-abi=hard    
-mcpu=cortex-a7 --sysroot=/opt/PHYTEC_BSPs/yocto_imx7/build/tmp/sysroots
/imx7d-phyboard-zeta-001 -c -pthread -std=c++11    -O2 -pipe -g  
-feliminate-unused-debug-types -fdebug-prefix-map=/opt/PHYTEC_BSPs 
/yocto_imx7/build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/imx7-2110
/0.1-r0=/usr/src/debug/imx7-2110/0.1-r0 -fdebug-prefix-map=/opt
/PHYTEC_BSPs/yocto_imx7/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-
map=/opt/PHYTEC_BSPs/yocto_imx7/build/tmp/sysroots/imx7d-phyboard-
zeta-001=  -fvisibility-inlines-hidden -g -c -Wall -Wextra -pthread 
-std=c++0x  pcieman_client.cpp -o pcieman_client.o
| In file included from pcieman_client.cpp:45:0:
| PktDriverUDPManager.hpp:18:41: fatal error: 
PktDriverAbstractionLayer.hpp: No such file or directory
| compilation terminated.
| make: *** [pcieman_client.o] Error 1
| WARNING: /opt/PHYTEC_BSPs/yocto_imx7/build/tmp/work/cortexa7hf-  
neon-poky-linux-gnueabi/imx7-2110/0.1-r0/temp/run.do_compile.7235:1 exit 2  
from 'make'
| ERROR: Function failed: do_compile (log file is located at   
/opt/PHYTEC_BSPs/yocto_imx7/build/tmp/work/cortexa7hf-neon-poky-linux-
gnueabi/imx7-2110/0.1-r0/temp/log.do_compile.7235)
ERROR: Task 6 (/opt/PHYTEC_BSPs/yocto_imx7/sources/meta-imx7-2110/recipes-
example/example/imx7-2110_0.1.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 351 tasks of which 346 didn't need to be   
rerun and 1 failed.
No currently running tasks (351 of 358)

Summary: 1 task failed:
  /opt/PHYTEC_BSPs/yocto_imx7/sources/meta-imx7-2110/recipes-example  
/example/imx7-2110_0.1.bb, do_compile
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
[root@localhost build]#

使用食谱更新:     #     #这个文件来自'Hello World!'中的示例食谱     #Yocto项目开发手册。     #

SUMMARY = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}                              
/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://build/build.tar.gz \ 
   file://src/src.tar.gz \
       file://include/include.tar.gz \  
       file://xpcie.h \
  "    

S = "${WORKDIR}"

#EXTRA_OEMAKE += "CPPFLAGS='-c -pthread -std=c++11'"
#EXTRA_OEMAKE += "CXXFLAGS='-g -c -Wall -Wextra -pthread -std=c++0x'"  

do_compile() {
     make 
}

do_install() {
     install -d ${D}${bindir}
     install -m 0755 pcieman_client ${D}${bindir}
}

这里还有补充信息:

# Define Compiler to use
CC=g++
# Define default compiler options
# Flags passed to the preprocessor.
CPPFLAGS=-c -pthread -std=c++11 
CXXFLAGS += -g -c -Wall -Wextra -pthread -std=c++0x 

LFLAGS=-Bsymbolic

all: pcieman_client    

pcieman_client:  pcieman_client.o parser.o udp_socket_class.o    
ds_api_class.o syn1588_class.o tr03_class.o pio_class.o search_api_class.o   
packet_proc_class.o socket_tools.o crc_calc.o stdafx.o transaction_class.o 
lpq_api_class.o fileIn_class.o vip_Rx_udp.o  vip_Tx_udp.o 
PktDriverAbstractionLayer.o PktDriverUDPManager.o StateMachine.o 
MessageEvent.o appl_menu.o 
$(CC) $(LFLAGS) -lpthread pcieman_client.o parser.o udp_socket_class.o  
ds_api_class.o syn1588_class.o tr03_class.o pio_class.o search_api_class.o 
packet_proc_class.o socket_tools.o crc_calc.o stdafx.o transaction_class.o 
lpq_api_class.o fileIn_class.o vip_Rx_udp.o vip_Tx_udp.o   
PktDriverAbstractionLayer.o PktDriverUDPManager.o StateMachine.o 
appl_menu.o MessageEvent.o  -o pcieman_client

pcieman_client.o: version.h udp_socket_class.h socket_tools.h 
packet_proc_class.h transaction_class.h parser_params.h parser.h 
pcieman_client.cpp 
$(CXX) $(CPPFLAGS)  $(CXXFLAGS) pcieman_client.cpp -o pcieman_client.o


udp_socket_class.o: udp_socket_class.h udp_socket_class.cpp
$(CC) $(CPPFLAGS) udp_socket_class.cpp -o udp_socket_class.o

appl_menu.o: appl_menu.hpp appl_menu.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) appl_menu.cpp -o appl_menu.o

ds_api_class.o: ds_api_class.h ds_api_class.cpp
$(CC) $(CPPFLAGS) ds_api_class.cpp -o ds_api_class.o

search_api_class.o: crc_calc.h search_api_class.h search_api_class.cpp
$(CC) $(CPPFLAGS) search_api_class.cpp -o search_api_class.o

pio_class.o: crc_calc.h pio_class.h pio_class.cpp
$(CC) $(CPPFLAGS) pio_class.cpp -o pio_class.o

syn1588_class.o: RxTx_settings.h syn1588_class.h syn1588_class.cpp
$(CC) $(CPPFLAGS) syn1588_class.cpp -o syn1588_class.o

tr03_class.o: RxTx_settings.h tr03_class.h tr03_class.cpp
$(CC) $(CPPFLAGS) tr03_class.cpp -o tr03_class.o

packet_proc_class.o: packet_proc_class.h packet_proc_class.cpp
$(CC) $(CPPFLAGS) packet_proc_class.cpp -o packet_proc_class.o

socket_tools.o: socket_tools.h socket_tools.cpp
$(CC) $(CPPFLAGS) socket_tools.cpp -o socket_tools.o

crc_calc.o: crc_calc.h crc_calc.cpp
$(CC) $(CPPFLAGS) crc_calc.cpp -o crc_calc.o

stdafx.o: stdafx.h stdafx.cpp
$(CC) $(CPPFLAGS) stdafx.cpp -o stdafx.o

transaction_class.o: packet_proc_class.h transaction_class.h   
transaction_class.cpp
$(CC) $(CPPFLAGS) transaction_class.cpp -o transaction_class.o

lpq_api_class.o: lpq_api_class.h lpq_api_class.cpp 
$(CXX) $(CPPFLAGS) $(CXXFLAGS) lpq_api_class.cpp -o lpq_api_class.o

fileIn_class.o: fileIn_class.h fileIn_class.cpp
$(CC) $(CPPFLAGS) fileIn_class.cpp -o fileIn_class.o

vip_Rx_udp.o: vip_Rx_settings.h RxTx_settings.h ds_api_class.h   
syn1588_class.h tr03_class.h pio_class.h lpq_api_class.h 
search_api_class.h PktDriverUDPManager.hpp  vip_Rx_udp.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) vip_Rx_udp.cpp -o vip_Rx_udp.o

vip_Tx_udp.o: vip_Tx_settings.h RxTx_settings.h PktDriverUDPManager.hpp  
vip_Tx_udp.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS)vip_Tx_udp.cpp -o vip_Tx_udp.o

parser.o: parser_params.h parser.h parser.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) parser.cpp -o parser.o

IGMPTimerManager.o: IGMPTimerManager.hpp IGMPTimerManager.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPTimerManager.cpp -o IGMPTimerManager.o

IGMPManager.o: IGMPManager.hpp IGMPManager.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPManager.cpp -o IGMPManager.o

IGMPNetworkManager.o: IGMPNetworkManager.hpp IGMPNetworkManager.cpp 
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPNetworkManager.cpp -o   
IGMPNetworkManager.o

IGMPHostEvent.o: IGMPHostEvent.hpp IGMPHostEvent.cpp 
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPHostEvent.cpp -o IGMPHostEvent.o

IGMPMulticastHost.o: IGMPMulticastHost.hpp IGMPStateMachine.hpp   
IGMPMulticastHost.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPMulticastHost.cpp -o 
IGMPMulticastHost.o

StateMachine.o: StateMachine.hpp StateMachine.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) StateMachine.cpp -o StateMachine.o

MessageEvent.o: MessageEvent.hpp MessageEvent.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) MessageEvent.cpp -o MessageEvent.o

IGMPV2StateMachine.o:  IGMPStateMachine.hpp IGMPV2StateMachine.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPV2StateMachine.cpp -o   
IGMPV2StateMachine.o

IGMPV3StateMachine.o:  IGMPStateMachine.hpp IGMPV3StateMachine.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPV3StateMachine.cpp -o  
IGMPV3StateMachine.o

IGMPStateMachine.o:  IGMPStateMachine.hpp IGMPStateMachine.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) IGMPStateMachine.cpp -o IGMPStateMachine.o

PktDriverAbstractionLayer.o: PktDriverAbstractionLayer.hpp  
PktDriverAbstractionLayer.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) PktDriverAbstractionLayer.cpp -o  
PktDriverAbstractionLayer.o        

PktDriverUDPManager.o: PktDriverUDPManager.hpp PktDriverUDPManager.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) PktDriverUDPManager.cpp  -o 
PktDriverUDPManager.o  

clean:
rm -rf *.o  pcieman_client

配置文件local.conf在这里:

MACHINE ??= 'imx7d-phyboard-zeta-001'
DISTRO ?= 'fsl-imx-x11'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
IMAGE_INSTALL_append=" xyzlayer"
IMAGE_INSTALL +="boost"
USER_CLASSES ?= "buildstats image-mklibs phytec-mirrors"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
ASSUME_PROVIDED += "libsdl-native"
CONF_VERSION = "1"

BB_NUMBER_THREADS = "8"
PARALLEL_MAKE = "-j 4"

DL_DIR ?= "/opt/PHYTEC_BSPs/yocto_dl"
ACCEPT_FSL_EULA = "1"

bblayer文件bblayers.conf在这里:

# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

 BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + 
'/../..')}"
BBFILES ?= ""

BBLAYERS = " \
${BSPDIR}/sources/poky/meta \
${BSPDIR}/sources/poky/meta-poky \
\
${BSPDIR}/sources/meta-openembedded/meta-oe \
${BSPDIR}/sources/meta-openembedded/meta-multimedia \
\
${BSPDIR}/sources/meta-fsl-arm \
${BSPDIR}/sources/meta-fsl-arm-extra \
${BSPDIR}/sources/meta-fsl-demos \
${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-bsp \
${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-sdk \
\
${BSPDIR}/sources/meta-browser \
${BSPDIR}/sources/meta-openembedded/meta-gnome \
${BSPDIR}/sources/meta-openembedded/meta-networking \
${BSPDIR}/sources/meta-openembedded/meta-python \
${BSPDIR}/sources/meta-openembedded/meta-filesystems \
${BSPDIR}/sources/meta-qt5 \
\
${BSPDIR}/sources/meta-phytec \
${BSPDIR}/sources/meta-phytec/meta-phytec-fsl \
    ${BSPDIR}/sources/meta-xyzlayer \
    ${BSPDIR}/sources/meta-testlayer \
  "

1 个答案:

答案 0 :(得分:0)

我在arm-poky-linux-gnueabi-g ++命令行中看到的缺点是包含路径的“-I”选项。由于bitbake环境变量会覆盖Makefile变量,因此可能需要使用以下内容(在do_compile()任务之前的配方文件中)显式指定包含路径:

TARGET_CFLAGS += " -I${S}"

假设头文件与源文件位于同一文件夹中。