Do you get any error message before all the undefinied references like cannot find lib called something? What are the first lines of output of the linker command?