Always look at the output of all the tools used to generate files, compile files, link files, ...
One common problem is that people think that qmake will run all the time. This is not true. If qmake thinks that it doesn't need to alter the makefile, it will not run. In some cases this is wrong.
Another problem might be that the compiler thinks that some files are not worth preprocessing anymore and it uses the existing object files. Sometimes incorrect.
How to solve these problems?
There is only one way to correctly build software and that is from scratch. Always clean the project from object files and generated files and rebuild.
In the past I made some changes to some KDE code. Before committing the changes I build the code and run the results to see if everything was correct. And everything always was correct before I committed the changes. But then, suddenly, someone complained that the code didn't even compile. How could that be? I checked it.
So, I double check it, and I compiled the code again (I didn't completely recompile though). Hmmm, strange, it does compile here. So I tell this other guy that he must have made an error somewhere.
Then another person tells me he can't build the code. I then started looking around what could be the problem. And some of the problems I experienced were that specific files did not get rebuild on my computer, but all these other people were building from scratch and on their computer those specific files did get rebuild resulting in some variables not being available anymore.
The tools we use are great, but when you build incrementally inside a folder that already contains generated objects and files, strange behavior can and will occur. Always clean the project and rebuild. If you're program is large, split it up in manageable parts.




Reply With Quote

Bookmarks