fix build problems on linux
fix darwin build errors
remove use of pragma unused
fix test_ldlibs usage bug