what else version than Ubuntu 12.10 do you suggest?
To be honest, I don't think that this is an error due to the system itself. There might be something wrong with configuration of linker or compiler.
Edit: I now used CMake to generate the Makefile and it work perfectly. Even the application in the end. Sadly CMake is a bit too complex to check the differences between my Makefile and the one produced by CMake.