The designer of StringUtils has developed a very bad API. None of the standard template library types should be used in the public API. std::string out of order. Therefore, if the compiler and libraries you are using are not the same compiler and libraries that are used by the StringUtils developer, the types can and are likely to be different. In fact, the developer of StringUtils was unable to separate the interface from the implementation .
Illustration of a problem. Suppose you are using MSVC 9.0 SP1 and I am using MSVC 8.0. In my compiler, an implementation of std :: string might look like this:
class string {
... but on your compiler it might look different:
class string {
If I write a library function:
void DoSomethingWithAString(std::string& str);
... and you name it, sizeof(string) in your code will be different from sizeof(string) in my code. Types do NOT match.
You really only have 2 solutions to your problem:
1) [preferred] Get an implementation of StringUtils to fix its broken code.
2) Replace the library used by your compiler with the library used by the StringUtil developer. Perhaps you can do this using the same compiler at the same fix level as the developer used, assuming that he did not replace the standard library implementation.
EDIT: 3) The third option is to stop using StringUtils. Honestly, this is probably what I would do.
source share