problem with and lapack library

Hi all,
I’m trying to include in my the library to compile a normal C code with the lapack function “sgesv_”, declaring it as an extern function. I don’t want to run it on cuda device, but only to use this as results reference dinamically. If I compile the code from shell using “gcc test.c -llapack” all it’s ok, but if I try to include -llapack in the LIB of the the compiler says me :

/tmp/ccKzh37o.o: In function main': main.c:(.text+0x111): undefined reference to sgesv_(int*, int*, float*, int*, int*, float*, int*, int*)’
collect2: ld returned 1 exit status
make: *** […/…/bin/linux/release/lapack] Error 1

I tried also to attach this flag in the CC command in “CC := gcc -llapack” , but it doesn’t work.
Please help me! :wacko:

you need to do -llapack after the source file you’re compiling, probably

Nooo! This is not right place to add it. CFLAGS is.

I tried also in this way, but it doesn’t work anyway