开发者

VS2010 Make bug in C++ when changing a .H file

开发者 https://www.devze.com 2023-02-15 17:58 出处:网络
I\'m using Visual 2010 for 6 month now, and i\'m having a build bug regulary. This bring me back in the dark age of visual 7 : When someone have a crash your first answer was : Did you make a rebuild

I'm using Visual 2010 for 6 month now, and i'm having a build bug regulary. This bring me back in the dark age of visual 7 : When someone have a crash your first answer was : Did you make a rebuild all ?

In my project if i modify one of my include file it sometimes doesn't recompile all the CPP file using this include file (it also happen without precompiled header, and i did find this bug in a.cpp using a.h and no other include file, so it was not "complicated" ) So some instance of my classes are incorrect. Many time if i modify a .H file, build, it build the project and say build successfull. Right after that if i do a rebuild all it found compilation error, of course i removed (for example) a member in my class and it didn't recompile.

I firs开发者_如何学Ct i was thinking, ok it's my project. (converted from Vs2003, Vs2005, Vs2008 and then Vs2010). So i tried for another project to start a VS2010 project from scratch. Only 10 cpp and 10 .h. No precompiled file. And i have the exactly same bug !

Installed the SP1 (that fixed the find windows !!) bug this bug is still here.

Anyone have a solution or is having the same bug as me, can't find anything on google about that ?


A couple ideas:

  1. Sometimes this can happen if there are oddities with your system clock or modified dates on the files. Try resetting the modified date. Maybe the easiest way is by zipping up the project, then extracting over top. Also of course delete your .suo and .ncb files.

  2. Make sure the .h file is IN the project tree. If it's #included, but not specifically in the project tree, I don't believe VS will recognize changes always.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号