关于A20硬件编码例子的编译问题。

wei你 2017-05-23 12:11:48
OS:ubuntu 16.10
编译器:arm-linux-gnueabi-gcc-4.7 ,arm-linux-gnueabi-g++-4.7
用A20的开发板,做视频硬件编码库,里面有几个例子,并有Makefile:
CPP = arm-linux-gnueabi-g++
STRIP = arm-linux-gnueabi-strip
AR = arm-linux-gnueabi-ar
CEDARX_CHIP_VERSION = A20

TARGET=encodeDemo
BUILDPATH=.

SRCDIRS:=.

CFLAGS =-Wall -O0 -g -ldl

INCLUDES:=$(foreach dir,$(SRCDIRS),-I$(dir)) \
-I../include \
-I../lib \
-I../include/include_system \
-I../include/include_vencoder \
-I../include/include_camera \
-I../include/include_platform/CHIP_$(CEDARX_CHIP_VERSION)/disp \
-I../include/include_platform/CHIP_$(CEDARX_CHIP_VERSION)

SRCCS=$(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.c))

LIBOBJ=$(addprefix $(BUILDPATH)/, $(addsuffix .o, $(basename $(SRCCS))))

LDFLAGS=-lpthread -lvencoder -ldl -L../lib/$(CEDARX_CHIP_VERSION) -L/usr/arm-linux-gnueabi/lib

all: $(TARGET)

$(BUILDPATH)/%.o:%.c
$(CC) $(CFLAGS) ${INCLUDES} $(LDFLAGS) -o $@ -c $<

$(TARGET):$(LIBOBJ)
$(CPP) $(LDFLAGS) -o $@ $^

clean:
rm -f $(TARGET) $(LIBOBJ)

这是make执行的编译命令
arm-linux-gnueabi-gcc -Wall -O0 -g -ldl -I. -I../include -I../lib -I../include/include_system -I../include/include_vencoder -I../include/include_camera -I../include/include_platform/CHIP_A20/disp -I../include/include_platform/CHIP_A20 -o main.o -c main.c
编译除了有几个警告外没什么问题。但连接它是用的arm-linux-gnueabi-g++做的,然后出现了很多未定义的引用。请问各位,这是怎么回事?应该怎么修改?

arm-linux-gnueabi-g++ -lpthread -lvencoder -ldl -L../lib/A20 -L/usr/arm-linux-gnueabi/lib -o encodeDemo main.o

main.o:在函数‘main’中:
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:151:对‘cedarx_hardware_init’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:153:对‘cedarvEncInit’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:165:对‘cedarvEncExit’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:168:对‘cedarx_hardware_exit’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:177:对‘cedarvEncExit’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:180:对‘cedarx_hardware_exit’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:191:对‘pthread_create’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:197:对‘pthread_create’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:203:对‘pthread_join’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:207:对‘pthread_join’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:211:对‘cedarvEncExit’未定义的引用
/home/ww/soft/linux-codec-release-V1.2/linux-codec-release-V1.2/encDemo/main.c:214:对‘cedarx_hardware_exit’未定义的引用
collect2: 错误: ld 返回 1
Makefile:35: recipe for target 'encodeDemo' failed
make: *** [encodeDemo] Error 1
...全文
194 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

21,597

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 驱动开发/核心开发
社区管理员
  • 驱动开发/核心开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧