Finally got it to build with extern.