I am writing a cross platform shared library (.so
in linux and .dll
in windows) using C. Currently when there is a error, library functions returns the
For log messages, you should allow the client to supply a callback function to the library so then the client can decide what to do with them e.g. send to syslog or display in a window on the screen.
For returning errors, you have three basic strategies:
Whatever you do, you don't want to just log the error message because the client might want to do something with it. e.g. present a dialog box.
I'd probably go with 2 mostly.