It shouldn't be a problem at all. 4000 lines may be long for a single file, but there are projects where such files exist, even longer, without causing any problems. You say your program crashes with some flags, yet it works if you change them. It can be caused by a faulty compiler (I guess you're using a good one and a stable version, so it shouldn't be it), or it can be caused by faulty code that may fail/work under some rare circumstances. Debugging that code is not easy, but, believe me, chances are it's really something in your code.
Now that I think of, there's another common situation: linking against non-updated object files or libraries. Does that file depend on some other kind of binary file? If so, please be sure to recompile everything and try again.
Another thing you may want to try is to debug a crashing binary. Just be sure to compile it with debugging symbols (-g) and _WITHOUT_ stripping (_WITHOUT_ -s), and run it through the debugger.
If nothing of that helps, at least give us more information about your environment: Operating System, Code::Blocks version, Compiler and version, ...