Sunday 15 March 2015

Compilation issues in C -



Compilation issues in C -

i have problem when compile programme , don't know why. think it's library problem i'm not sure. searched on google couldn't solve problem.

command line:

clang `pkg-config --libs opencv ` main.o image_handle.o image_detection.o neural_network.o -o main

this error message:

/usr/bin/ld: neural_network.o: undefined reference symbol 'exp@@glibc_2.2.5' //lib/x86_64-linux-gnu/libm.so.6: error adding symbols: dso missing command line clang: error: linker command failed exit code 1 (use -v see invocation) make: *** [main] error 1

edit: makefile

#for compilation cc=clang cppflags=`pkg-config --cflags opencv` cflags= -wall -wextra -werror -std=c99 -o2 ldflags=`pkg-config --libs opencv` src= main.c image_handle.c image_detection.c neural_network.c obj= ${src:.c=.o} all: main clean main: ${obj} clean: rm -f *~ *.o #end

/lib/x86_64-linux-gnu/libm.so.6: error adding symbols: dso missing command line

that's linker telling sort of found symbol looking for, not in library asked link with. should add together library command line. flag libm -lm

clang main.o image_handle.o image_detection.o neural_network.o \ `pkg-config --libs opencv ` -lm -o main

(you set libraries after objects require them on command line.)

c compilation linker-error

No comments:

Post a Comment