0

Can anyone help me understand what is creating these error messages?

undefined reference to `_imp___ZN2sf6Sprite14setTextureRectERKNS_4RectIiEE'
undefined reference to `_imp___ZN2sf7TextureD1Ev'
undefined reference to `_imp___ZN2sf7TextureD1Ev'
undefined reference to `_imp___ZN2sf7Texture9setSmoothEb'
undefined reference to `_imp___ZN2sf7Texture12loadFromFileERKSsRKNS_4RectIiEE'
undefined reference to `_imp___ZN2sf7TextureD1Ev'
undefined reference to `_imp___ZN2sf7TextureD1Ev'
undefined reference to `_imp___ZN2sf7TextureD1Ev'

I get these when working on project A which uses static library B, after making some small changes in B which compile without errors. I've recompiled everything. I'm assuming that it's somehow related to statically linking to library B.

I'm using mingw and codeblocks.

A.B.
  • 15,364
  • 3
  • 61
  • 64
  • The link doesn't tell me how to actually fix the problem. Project A has been using library B without any problems until now and the only thing that changed was a file in library B. Yet recompiling doesn't fix the problem. – A.B. Jun 23 '13 at 17:14
  • The odd naming of functions is called [name decoration or name mangling](http://en.wikipedia.org/wiki/Name_mangling). – Captain Obvlious Jun 23 '13 at 17:14
  • Those are [mangled names](http://en.wikipedia.org/wiki/Name_mangling) of functions, presumably from library B. Most likely, you need to "clean" project A, and then build. It likely has objects sitting around that refer to the old signatures of functions in B. – Markku K. Jun 23 '13 at 17:15
  • Still getting the errors after cleaning and rebuilding both projects. – A.B. Jun 23 '13 at 17:18
  • Read _all_ of the answers in the linked duplicate. Especially the one concerning [`__declspec(dllimport)` _and_ `__declspec(dllexport)`](http://stackoverflow.com/a/12574423/845568) – Captain Obvlious Jun 23 '13 at 17:29

0 Answers0