Home Help Center

_BLOCK_TYPE_IS_VALID errors under Windows?

waleedkwaleedk Member Waleed KadousOrganization: University of New South WalesProject: ORCA/Rescue
Hi There,

I've been working on trying to port an existing project to Windows. I am getting some very unpredictable behaviours, especially when compiling with Visual Studio .NET 2003.

Consider for example, the following simple bit of code that uses the Ice library:
#include <iostream> 
#include <Ice/Ice.h>

 using namespace std; 

int main(int argc, char *argv[]){
    Ice::StringSeq args = Ice::argsToStringSeq( argc, argv );
    args.push_back("ExtraArg"); 
    for(int i=0; i < args.size(); i++){
        cout << "Arg " << i << " is " << args[i] << endl; 
    }
}

Now, when I compile and run this, I get the following error message:
Debug Assertion Failed!
Error: dbgdel.cpp
Line 52

Error: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

Any ideas why this is happening with what appears to be a well-written and simple program? Is it a bug in the Ice libraries, or am I missing something simple?

Regards,


Waleed.

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Waleed,

    It's a simple problem: you're mixing /MD and /MDd libraries.
    See http://www.zeroc.com/faq/windowsLibraryMixup.html

    Best regards,
    Bernard
  • waleedkwaleedk Member Waleed KadousOrganization: University of New South WalesProject: ORCA/Rescue
    Thanks for the prompt and appropriate response. I really appreciate it!
Sign In or Register to comment.