简体   繁体   中英

C++ Builder XE3 run & crash BEFORE the main()

I have some troubles with Embarcadero C++ Builder XE3. When I run my program, I have an access violation BEFORE the first instruction in the main...So I can't debug, it's very weird.

I used to have this problem a couple of weeks ago : I was forced to full rebuild the entire projet (even if only a comma was missing...) and the violation didn't occurs anymore. I solved it by ckecking the option "Disable incremental link".

I was very happy, but today, the problem is back, and whatever I do, my application crash before enterring in the main ...

Does anyone have an idea ? It's a big project, so I can't really post an exemple because I don't really know what to show...

Thanks a lot

Probably you have a bug in a constructor of a static global object. These constructors are all executed before getting into main() , so this can happen without being a runtime environment or a compiler bug.

As you told, debugging these is difficult as you probably don't know which class is failing, and probably you don't have exception info also.

As you say it's a large project, perhaps you have to resign to use large project toolkits/methodologies to deal with these problems, like unit testing and lean methodologies (like scrum or the like).

With the information you post I think this is the most can be said.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM