Thursday, 14 April 2011

You think you know everything about SOURCES files

... but sometimes there are strange mysteries to fix.
This lines are very common in SOURCES files:
INCLUDES= \
$(INCLUDES); \
MyIncPath; \

But sometimes you have to change the order of include pathes
in order to find a header file in MyIncPath first:
INCLUDES= \
MyIncPath; \
$(INCLUDES); \


That's the compiler message and it isn't helpful as always:
BUILD: [01:0000000029:ERRORE] cl : Command line error D8004 : '/I' requires an argument

Even Build.log doesn't clear the clouds:
BUILD: [01:0000000027:INFO ] cl -nologo ...
-Ix86\ -I. -IMyIncPath

-IC:\WINCE600\public\common\oak\inc

-IC:\WINCE600\public\common\ddk\inc

-IC:\WINCE600\public\common\sdk\inc

-I
-I.\Resource\0409 ... C:\WINCE600\platform\MyBSP\Src\Drivers\MyDriver\.\MyFile.cpp

Yes, there is an extra "-I" parameter, but why?

The answer is simple:
INCLUDES= \
MyIncPath; \

$(INCLUDES)

Do you see the difference?

Tschüß Holger

No comments: