0

Getting many versions of the following linker error in XE5.

[ilink32 Error] Error: Unresolved external '__stdcall System::UnicodeString::~UnicodeString()' referenced from <Location>

From everything I've read so far, this seems like I have something wrong with my include structure in the project settings and have no access to where all the string methods are actually defined, but for the life of me, I cannot figure out where these are supposed to be.

SeaNick
  • 501
  • 1
  • 4
  • 14
  • Going to be hard for us to figure out from here, given that we cannot see any code. – David Heffernan Mar 19 '14 at 22:09
  • I did not include code because this does not seem to be a code issue, other than the fact that somewhere in the code I've declared a UnicodeString. The problem is (as is mentioned below) that the linker cannot find the definition of the constructor for UnicodeStrings, which is somewhere in an RTL library. But even though I've pointed added all of the paths I can find related to RTL and ustring in the library and include path lists, it still does not seem to find them. – SeaNick Mar 20 '14 at 17:23

1 Answers1

1

This problem has nothing to do with includes. Include problems only affect the compiler. Your project is using the UnicodeString class, so the compiler generates references to UnicodeString's methods based on how they are declared in ustring.h, and that keeps the compiler happy.

You are getting a linker error instead, because it cannot resolve the references that the compiler generated. That means your project is missing a required reference to Embarcadero's RTL library that implements the actual UnicodeString method bodies. That likely suggests your project was created/imported incorrectly to begin with, or has become corrupted. You may have to recreate the project from scratch so the default library references are used, and re-add your existing code files to that new project.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • This project was native to CodeGear 2007 and I am porting it to XE5. I guess the question is where does the rtl library reference get placed in the project settings? My thought was in the include list, but like you said, that's not correct. – SeaNick Mar 20 '14 at 15:31
  • DO NOT open an existing project from an older IDE version in a newer IDE version and let the IDE migrate it for you. It RARELY ever works correctly, and missing library references in one common side effect of doing that. ALWAYS create a new project in the newer IDE version and then add your existing source files to it as needed. – Remy Lebeau Mar 20 '14 at 19:10
  • I'm battling with a tradeoff at the moment, because I'm also crossing over the Unicode changes that occurred between 2007 and XE5, so a straight import results in a whole lot of pain in incompatible code. Either way I'm having to reconfigure all sorts of project settings... But thank you for the help so far! – SeaNick Mar 20 '14 at 19:18