Kadence 0 Light Poster

I have LAPACK and am having problems trying to compile while linking to it with g++ (MinGW and MinGW 64, have and tried both) using the following command:

g++ main.cpp -I"C:\Program Files (x86)\University Of Tennessee\LAPACK 3.1.1\lib\x64" -L"C:\Program Files (x86)\University Of Tennessee\LAPACK 3.1.1\lib\x64" -llapack -lblas

Even though I'm adding the include path and linking to the library, I'm still getting an

undefined reference to `sgels_'
collect2: ld returned 1 exit status

error. I also tried lib\win32 for the include and library paths instead of lib\x64.

I do have

extern "C" void sgels_ ( ... );

At the top of the file using sgels_().

How am I linking incorrectly, or doing incompletely?