I'm surprised that such a simple task is so complicated with CodeBlocks.
Once you solved your riddle, you will find that CB is very easy to use with DLLs/SOs. I am using SO's all the time and its just adding a path and a single name in CB,
As I did a few year ago, you might be surprised about the technical details of DLLs/SO's. Although DLLs and SOs are basically the same they follow different rules in Windows and Linux. They must to handle multiple versions on the same lib on system level, there are major differences between DLLs in C and C++ (keyword name mangling) and the fact that C++ DLLs only work if they were done with the same compiler as stahta01 wrote and more. Each OS creates a set of rules you must obey. On a microcontroller much of that is not an issue, making things a lot easier.
When I started with Visual Studio I was totally ignorant of all of this. I could copy & paste DLL code but I was a script kiddie rather than a programmer beacause I did not really understand what I was doing. From your posts I would guess you are not aware of any of those complexities as well. I am not implying you are not a good programmer (as I was), but you might have some things to catch up on DLLs.
So do you mean that CodeBlocks does not allow the use of DLLs?
Of course not, why should it? The use of DLLs in computer programming is so extraordinary rare that over 20 years of CB development you are the first user ever even mentioning that. Maybe you should consider filing a feature request for it. (irony off)
There was a Mercedes Benz S-Class driver asking after a test drive why the vehicle of the current Rallye motorsport world champion was so badly designed that you could not do a controlled turn with it? I wonder does this question tell more about the vehicle or about the questioner?
Seriously, I can see you are frustrated.
Please allow me to point out a key item about CB: Its an open system. It allows you to use any compiler on any of the major OS including Arm compiler and MS visual studio's compiler. However, this flexibility and openess comes with a price: I does not shield you from technical complexiities as other IDEs do. There is a chance that if you do not understand what you are doing, you will fail. Embedded dev environments, VisualStudio and probable also Apple dev environments are tight and closed. They can be, because there is only only one way of doing things and the tools know all the fixed parameters and can do things for you.
It possible to extend CB to do the same, e.g. a DLL creation wizard for Windows, but you would need one for each combination of compiler and OS. Yet nobody thought such a thing was worthwhile, because knowing the basics and using the CB core facilities is the better option in the long run.
What CB is lacking though and what would help people in your situation is easyly accessible documentation like an help with How-Tos and examples or tutorials. But I am sure also in your case once you solved the issue like all people before you you will not gather enough motivation to sit down and write up a documentation like that. And once you have mastered the skills to use CB as a efficient tool you will lack the motiviation for it. Welcome to the viscious circle of open source.
That's probably what I will end doing.
I am sorry I can not help you further on windows. Sitting in front of your terminal with the lib, the full log output and dev tools I m sure its easy to solve. However, I am sure what you say is the best way forward.
To get a feel for what is behind DLLs I can recommend David A. Wheelers paper "Program Library HOWTO" from May 15, 2010. I am sure google will find it. Although its Linux also Win users cross reading the 25 pgs should get a good feel why DLLs are more than they seem on the first glance. Win has the same issues, just different solutions. After reading you might see why here we fail to give you just the right cue.