1

Recently i have been experiencing more and more corrupt builds. For instance when i access

 npc[4] 

it accesses

 npc[3]. 

Or instead of

details->Hp 

it returns

details->Energy. 

Problem magically fixes itself when i rebuild. (after i spent hours trying to find the non-existing bug of course)

This is getting more frequent while my project gets bigger and bigger. Why does something like this occurs? How can i avoid it?

I hope i made myself clear.

thank you.

7
  • I would assume you have a bug somewhere ;) Commented Jan 6, 2012 at 0:17
  • If it fixes itself when you rebuild, when does it break itself? Commented Jan 6, 2012 at 0:17
  • 2
    There is insufficient information to answer the question. What version of Visual Studio? Is this a multi-project solution? Are you sure that all of the project and library dependencies are configured correctly? Are you sure that all of your projects and source files are built with the same options? From your description, it sounds like you are violating the one-definition rule (ODR) because something isn't being rebuilt as required. Commented Jan 6, 2012 at 0:18
  • visual studio 8. i appears out of nowhere. i wasnt even editting the problamatic part. game uses a lot of static and dynamic libraries, but corruptions occur in my own code. Commented Jan 6, 2012 at 0:19
  • 1
    I believe this is a problem with pre-compiled headers. When I developed in Visual Studio, I found that this type of decay goes away when NOT using pre-compiled headers. Of course, your build will take longer without pch. Commented Jan 6, 2012 at 7:11

1 Answer 1

1

thanks for the comments. i have found the problem. precompiled headers. they get corrupted after a while and cause unintended behaviors. there doesn't seem to me solution at the moment since I'm forced to use pchs.

Sign up to request clarification or add additional context in comments.

2 Comments

AFAIK if you edit a header whic get's included into precompiled header then you have to recompile PCH manualy :D if you don't you got errors
most of the time it doesn't care. but apparently not all the time.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.