Regenerating .o files

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Regenerating .o files

1,502 次查看
tomcarney
Contributor I

I have a project which has a large number of precompiled .o files.  I also have the source code to generate these files but they are not currently a part of the project. I want to change the project so that every time I rebuild, the .o files are generated from scratch from the .c and .h files so that I can debug the code, but I can't figure out how to do this.

If I clean the project, the .o files remain, and if I just drop the source files into the project I get compile errors from multiple definition of the functions in the source files. If I just delete the .o files and try to rebuild I immediately get a dialog-box error message to the tune that :

"  'build project' has encountered a problem. Errors occurred during the build. "

I am assuming that there is some project setting which stipulates that the .o files are all there, precompiled and ready to use, but I cannot find it. Could anyone point me in the right direction?

Thanks

Tom

标记 (2)
0 项奖励
回复
2 回复数

1,438 次查看
bobpaddock
Senior Contributor IV

https://www.nostarch.com/gnumake/  is worth reading.  The free sample chapter on 'pitfalls' of Make may help with your problem.

What is needed is two different Makefiles for the two projects (two different sets of .o's make it two projects) with one parent Makefile.  

0 项奖励
回复

1,438 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Tom,

What about your project ? Could you please share it or show the steps and errors when you clean

and build .

I made a simple test on my side , build->clean->build. when clean the project, the .o files can

disappear , please have a look at my attachment .

Hope it helps


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复