Tuesday, April 15, 2008

Did you know that ? fatal error C1091: compiler limit

It doesn't happen every day to find a new compiler error message. Here's one I didn't expect:

fatal error C1091: compiler limit: string exceeds 65535 bytes in length

I was about to complete my programming task when this error struck and I really needed a very long string. On VC++ 2003 compiler the limit is even smaller, 16 Kb.

The conclusion of this story: don't put the whole story of your life inside a C++ string constant!


Unknown said...

And how did u manage to pass throw?

Unknown said...

I used a CString object and I appended chunks of the huge string to it. Another approach could use a large enough buffer and strcpy.