OpenCV link error

I tried to build an openCV code using gcc and I link the file to the compiler, but I get the following error.

gcc -lm /lib/arm-linux-gnueabihf/ OpenCV_Tests.c pkg-config --cflags --libs opencv

/usr/bin/ld: /tmp/ccve61Id.o: undefined reference to symbol ‘lrint@@GLIBC_2.4
/usr/bin/ld: note: ‘lrint@@GLIBC_2.4’ is defined in DSO /usr/lib/gcc/arm-linux-gnueabihf/4.7/…/…/…/arm-linux-gnueabihf/ so try adding
it to the linker command line
/usr/lib/gcc/arm-linux-gnueabihf/4.7/…/…/…/arm-linux-gnueabihf/ could not read symbols: Invalid operation

Please give any suggestions to do this.