FYI:
I recently found that msys2 has a nice tool named pkg-config, which is located in msys2_root/mingw64/bin/pkg-config.exe
Now, I see in code::blocks, it can support many libraries. For example, if you want to link opencv library.
You just have to add one line in compiler options in C::B build option
`pkg-config --cflags opencv4`
and in library options in C::B build option
`pkg-config --libs opencv4`
Really nice feature, also, I think it should also work under Linux.