I was looking for hiding methods in dlls. In MSVC there is a way to create a def file and link it with the NONAME attribute (see here).
Is the same possible in MinGW?
You can use a GCC extension, the visibility attribute :
__attribute__ ((visibility ("hidden")))