Yes, you can do that - its perfectly functional as both a static (.a) and a dynamic lib (.dll) in Windows. It's also just fine as a shared lib (.so) under Linux. (didn't bother to try a static lib in linux) - all code built with Code::Blocks & GCC
I'm pretty tired now, so I'm not really so good at summarising :( So I'll just leave the contents of the files I used.Part 1 - the library.
extern int some_function(int t);
#endifPart 2 - The program
int some_function(int t)
printf("You entered %d\n", t);
you entered 10