add -DLIBRARY_EXPORTS to FLAGS

use hex code for escape

explicit casts