fix linux compile

various compilation issues and missing stuff. still does not link