Add GCC support and fix link errors