Engine compilation oddity
by Rodney (OldRod) Burns · in Torque Game Engine · 08/28/2001 (5:40 pm) · 4 replies
Ok, I compiled the engine and it works fine. Then I added a modified version of the health bar gui from another post here and it worked fine.
So, feeling cocky, I modified it slightly and hit F7 to compile, which only recompiled the one .cc file I had changed. It compiled with no errors/warnings, but blew up when I clicked on the connect button.
I did a full rebuild of the entire engine (which takes about 15 mins on my machine) and it works.
Why is there a difference between the two builds? I've never run into this before.
So, feeling cocky, I modified it slightly and hit F7 to compile, which only recompiled the one .cc file I had changed. It compiled with no errors/warnings, but blew up when I clicked on the connect button.
I did a full rebuild of the entire engine (which takes about 15 mins on my machine) and it works.
Why is there a difference between the two builds? I've never run into this before.
#2
08/28/2001 (10:34 pm)
Just curious, but are all these little tid bits being added to a FAQ somewhere? I can imagine the horror of trying to find them in the threads later 8)
#3
The problem only appears to be with the release build. I can compile the debug version the way I want and do quick testing. I just have to do a full rebuild if I want to use the release version. That's not so bad.
I'll check out those settings, though. That sounds like it's probably the culprit :)
08/29/2001 (3:25 am)
Wow. Thanks for the information. I think I'm confused now =)The problem only appears to be with the release build. I can compile the debug version the way I want and do quick testing. I just have to do a full rebuild if I want to use the release version. That's not so bad.
I'll check out those settings, though. That sounds like it's probably the culprit :)
#4
You can also see this phenomenon if you change the signature of a virtual function. Even though some of the derived classes don't use this virtual method, they still need to be recompiled because their v-table information needs to be regenerated. Because VC is not rebuilding dependant files, you will get a linker error from those derived classes telling you that it cant find the old virtual method.
A "rebuild all" works becuase those dependant files are getting recompiled. If you just change implementation code (in .cc) files, everything generally works fine. It's just when you change class definitions that other classes depend on - that causes the problems.
We have had this problem in the past with VC here at work and the problem can be resolved via some magic project settings, I hope. I am going to try and figure it out this week and will post any information I can find.
08/29/2001 (10:01 am)
I am seeing the same behavior when using VC to try and incrementally build header file changes. It does not appear that dependant files are getting compiled automatically - which will wreak havoc on the EXE. You wont get any compile errors because VC is just sompiling your changes - not the dependant files.You can also see this phenomenon if you change the signature of a virtual function. Even though some of the derived classes don't use this virtual method, they still need to be recompiled because their v-table information needs to be regenerated. Because VC is not rebuilding dependant files, you will get a linker error from those derived classes telling you that it cant find the old virtual method.
A "rebuild all" works becuase those dependant files are getting recompiled. If you just change implementation code (in .cc) files, everything generally works fine. It's just when you change class definitions that other classes depend on - that causes the problems.
We have had this problem in the past with VC here at work and the problem can be resolved via some magic project settings, I hope. I am going to try and figure it out this week and will post any information I can find.
Associate Matt Fairfax
PopCap