Unfortunately libraries (dll, so) are not yet supported in the release 2.2. Work is in progress, in git main.
For this the IDE still supports the gdb based debugging.
Both debuggers should be configured in the IDE. You can choose a debugger in the project settings, so you do not need to toggle the global options all the time.
Simply for any project with libraries, switch the project settings to gdb.