Question & Answer
Question
What could cause "Cannot open include file: 'myfile.h': No such file or directory." error when building an IBM Rational Rhapsody model?
Cause
One of the potential causes is that the list of include files that you specified in the "Configuration -> Settings -> Include Path" property, was using an incorrect separator e.g. using a "\"
Let's say, for example, that myfile.h is located in "C:\src\lang\cpp\CppUtils". In the configuration features, the Include Path box is entered as:
C:\src\lang\cpp\CppUtils \
/IC:\src\lang\cpp\cpp \
/IC:\Users\SAF\Documents\MoreSRC\src
The include path in the makefile comes out as:
INCLUDE_PATH= \
$(INCLUDE_QUALIFIER)"C:\src\lang\cpp\CppUtils \
/IC:\src\lang\cpp\cpp \
/IC:\Users\SAF\Documents\MoreSRC\src" \
$(INCLUDE_QUALIFIER)$(OMROOT)/LangCpp/osconfig/WIN32
Note the quotes in the generated makefile.
The above causes a problem because the included files not being recognized.
Answer
To address the issue, you must use "commas" to separate the different locations. For example:
C:\src\lang\cpp\CppUtils
,C:\src\lang\cpp\cpp
,C:\Users\SAF\Documents\MoreSRC\src
which results in the include path in the makefile:
INCLUDE_PATH= \
$(INCLUDE_QUALIFIER)C:\src\lang\cpp\CppUtils \
$(INCLUDE_QUALIFIER)C:\src\lang\cpp\cpp \
$(INCLUDE_QUALIFIER)C:\Users\SAF\Documents\MoreSRC\src \
$(INCLUDE_QUALIFIER)$(OMROOT)/LangCpp/osconfig/WIN32
With the above, the build should not give the error.
Please note that there are other cases where the error appears and you may encounter further build errors. This technote applies to when you have used an incorrect separator. If you have used the correct separator and still seeing issues, then please contact IBM Rational Client Support for further assistance.
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21657403