I’m currently working on a project which creates a static library and three executables that link to this library. On a clean build when I try to create the library on OSX 10.7.1 it will build correctly. However if it’s not a clean build then I get this error.
ld: in ./libframework.a, malformed archive TOC entry for GameApp::~GameApp(), offset 222233108 is beyond end of file 3056 for architecture x86_64
Without changing any build settings if I do a clean build after receiving this error then it will compile without issues. The linking error doesn’t seem to always apply to the same entry. If I comment out the desctructor then it will just refer to another entry.
Any ideas?
The error here is that the table of contents of the static library need to be updated when recompiling. To fix this the -s flag can be added to ar or ranlib can be executed after compiling the library but before linking.