I am trying to compile a program that uses a shared library. I am using the MinGW compiler. My library file is called libtest.c and I have compiled it into a libary using these commands:
gcc -c -fpic ..\source\libtest.c
gcc -shared -o libtest.so libtest.o
I get a libtest.so file so I am assuming it worked well.

Now I try to compile the file containing the program (called mainprog.c) using this command:
gcc -I..\bin -L..\bin -o mainprog ..\source\mainprog.c -ltest

then the compiler complains it cannot find -ltest

I am calling the compiler from within the bin-directory, so it should be pointed right.
I am sure it is somehting stupid, but I am getting blind for it I guess.
Any help would be appreciated.