When running the application program on the ARM embedded development board, the following error appears: “inconsistency detected by LD. So: DL DEPs. C: 622:_ dl_ map_ object_ deps: Assertion `nlist > 1′ failed!”, The reason for this error is that the third-party library is not used correctly. I used the libpthread Library in the program, but I used the dynamic link library method. When I add the – static option in the compilation parameters and change it to static link libpthread library, this problem is solved and the program runs normally.
My makefile is posted below for reference:
src = $(wildcard ./*.c)
obj = $(patsubst ./%.c, ./%.o, $(src))
target = can_test
CROSS_COMPILE = arm-xilinx-linux-gnueabi-gcc
FLAGS = -lpthread -static
$(target):$(obj)
$(CROSS_COMPILE) $^ -o $@ $(FLAGS)
%.o:%.c
$(CROSS_COMPILE) -c $< -o $@ $(FLAGS)
.PHONY:clean
clean:
rm $(obj) $(target) -f
Similar Posts:
- Hi3516DV300 Chip Error: “undefined reference to ×”
- [Solved] LD: library not found for – XXX when Xcode compiles code
- Makefile:xxx: recipe for target ‘xxx’ failed
- How to Solve Redis Error: /bin/sh: cc: command not found
- Undefined reference to ` SEM appears when compiling with tcmalloc_ init’
- Eclipse C/C++ Error: launch failed,binary not found
- undefined symbol: xxx – undefined reference to `typeinfo
- LIBRARY_ Path and LD_ LIBRARY_ The difference of path environment variable
- Syntax error: word unexpected (expect