Build lib and then use it in main.