How exactly do you link the library? If you use option -lfoo, then the linker will search all library directories – the default library directories as well as those added by -L option – for either libfoo.dll.a (shared lib) or libfoo.a (static lib). And it probably prefers the "shared" library, if both are available.
Instead of using -lfoo, you can enter /path/to/libfoo.a directly, to ensure that "static" library is linked.
(you can add -Wl,--trace to get more detailed output of which libraries are searched/used)
But, be aware that the "static" library you are trying to link can have some dependencies of its own! If so, then those dependencies have to be linked as well, or linking will fail with "undefined references" errors...