天嵌 ARM开发社区

 找回密码
 注册
查看: 1906|回复: 0

编译错误:arm-linux-ld: unrecognized option '-D_GNU_SOURCE=1'

[复制链接]
dunken 发表于 2014-1-4 11:18:32 | 显示全部楼层 |阅读模式
本帖最后由 dunken 于 2014-1-4 11:24 编辑

开发板是TQ2440
编译器是:4.3.3
root@ubuntu:server# arm-linux-gcc -vUsing built-in specs.Target: arm-none-linux-gnueabi
Configured with: /scratch/maxim/arm-lite/src-4.3-arm-none-linux-gnueabi-lite/gcc-4.3/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu -
。。。。。。。。。。
Thread model: posixgcc version 4.3.3 (Sourcery G++ Lite 2009q1-176)
root@ubuntu:server# arm-linux-ld -v
GNU ld (Sourcery G++ Lite 2009q1-176) 2.19.51.20090205


root@ubuntu:server# make
arm-linux-gcc -Wall -c -o camera.o camera.c
arm-linux-gcc -Wall -c -o main.o main.c
arm-linux-gcc -Wall -c -o sdl.o sdl.c
arm-linux-gcc -Wall -c -o sender.o sender.c
arm-linux-gcc -Wall -c -o encode.o encode.c
arm-linux-gcc -Wall -c -o public.o public.c
arm-linux-gcc -Wall -c -o opt.o opt.c
building...
arm-linux-ld --warn-unresolved-symbols --wrap _GNU_SOURCE -o camera camera.o main.o sdl.o sender.o encode.o public.o opt.o -lswscale `sdl-config --cflags --libs`  -lavformat -lavcodec -lz
arm-linux-ld: unrecognized option '-D_GNU_SOURCE=1'
arm-linux-ld: use the --help option for usage information
make: *** [camera] Error 1


Makefile文件如下:
SUBDIRS = SRC_FILE = camera.c main.c sdl.c sender.c encode.c public.c opt.c
OBJ_FILE = $(patsubst %.c,%.o,${SRC_FILE})
EXEC = camera
VPATH=$(SUBDIRS)
CC = arm-linux-gcc
LD = arm-linux-ld
CXXFLAGS =
CFLAGS = -Wall -cLDFLAGS =
LIBS = -lswscale `sdl-config --cflags --libs`  -lavformat -lavcodec -lz
all : $(EXEC)        
                  @echo finished ...
$(EXEC):$(OBJ_FILE)      
                @echo building...        
                $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
%.o:%.c      
                $(CC) $(CFLAGS) -o $@ $<
clean:      
                rm $(EXEC) $(OBJ_FILE)        
                 @echo clear!







您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2025-6-18 07:42 , Processed in 2.045448 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表