Why does CW 10.4 attempt to compile a .c file not in source directory

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Why does CW 10.4 attempt to compile a .c file not in source directory

2,675件の閲覧回数
leonmcnutt
Contributor I


I have a construction file that just happens to have an .c extenstion which I #include in my source .c file. My source units compile correctly, however the IDE  attempts to compile my construction file too which stops the build.  I changed the extension of the construction file (.cw2) and I get my static library built. Why  is the IDE attempting to build with .c files outside of the source directory?

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

2,581件の閲覧回数
stanish
NXP Employee
NXP Employee

Hello Leon,

The automatic CodeWarrior Makefile generator uses all the files with source file extension within project directory to build regardless of sub-folder where a file is placed.

So if your .c file you are including is not placed completely outside the project directory it will be compiled by default.

However you can explicitly exclude the file from build to avoid compilation of the file. (Click Right on the file -> "Resource Configuration" -> "Exclude from Build..." )

Make sure the include path  to the file is set in the compiler input settings/ Includes path settings.

Stanislav

0 件の賞賛
返信

2,580件の閲覧回数
leonmcnutt
Contributor I

Stanislav,

Thanks for the help!

0 件の賞賛
返信

2,580件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

don't quite understand your situation. can you please upload your project to showcase the problem?

0 件の賞賛
返信