OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000297OMNeT++IDE / C++ developmentpublic2011-05-11 07:022011-05-11 07:04
andras 
andras 
normalminorhave not tried
resolvedfixed 
4.1 
 
0000297: Build: inclusion of _m.h files may fail due to .msg file not translated to C++ in time
Sometimes there are spurious "cannot include xxx_m.h: no such file or directory" errors during build, while the corresponding .msg file exists. The Makefile somehow doesn't invoke opp_msgc in time for that .msg file.

Analysis reveals that this happens when the .cc file includes xxx_m.h via a header file (say foo.h) which is marked as "ambiguous include" in the IDE. (The warning for the #include "foo.h" line is: "Makefile autodeps: ambiguous include (more than one matching file found)", meaning there are more than one foo.h files in the project.) Looking at the Makefile, the dependencies for the .cc file DON'T contain foo.h (or xxx_m.h), which is apparently why make doesn't know that xxx_m.h will be needed for compiling the .cc file, and doesn't invoke opp_msgc.

Thus, the root cause of the problem seems to be that the makefile generator leaves out ambiguous includes from the dependencies. Instead of leaving out foo.h, it should play safe and list both (all) foo.h files in the project as the dependency of the .cc file.

No tags attached.
Issue History
2011-05-11 07:02andrasNew Issue
2011-05-11 07:04andrasNote Added: 0000436
2011-05-11 07:04andrasNote Added: 0000437
2011-05-11 07:04andrasStatusnew => resolved
2011-05-11 07:04andrasFixed in Version => 4.2b3
2011-05-11 07:04andrasResolutionopen => fixed
2011-05-11 07:04andrasAssigned To => andras

Notes
(0000436)
andras   
2011-05-11 07:04   
Events go like this:
 - #include "TED.h" is ambiguous in some Foo.cc
 - thus, files that TED.h includes are not counted as dependency for Foo.cc
 - so, if even TED.h includes IntServ_m.h, IntServ_m.h is NOT listed in Foo.cc's dependency list in the generated Makefile
 - therefore, the Makefile doesn't ensure that IntServ.msg is processed with opp_msgc before Foo.cc is compiled
 - result: IntServ_m.h is missing when Foo.cc is compiled --> ERROR
(0000437)
andras   
2011-05-11 07:04   
Fixed.