IBM Support

Building an IBM Rational Rhapsody model gives error "Cannot open include file: 'myfile.h': No such file or directory. "

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":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Documentation","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.1;8.0.2;8.0.3;8.0.4","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21657403