Archived

This forum has been archived. Please start a new discussion on GitHub.

include order matters?

I've noticed that my header generation is slightly different based on the order I add "-I" includes to the slice2cpp line. It may be intentional, but I'm not sure.

For example, if I have /g4/ice/aei_facility/aei_facility.ice which has the line:

#include <aei_fuel.ice>

which is another slice file in the same directory, then I do this:

slice2cpp /g4/ice/aei_facility/aei_facility.ice -I/g4/ice -I/g4/ice/aei_facility

The generated .h contains this line:

#include <aei_facility/aei_fuel.h>


However, if I switch the order of the includes:

slice2cpp /g4/ice/aei_facility/aei_facility.ice -I/g4/ice/aei_facility -I/g4/ice

The generated .h file does this:

#include <aei_fuel.h>

Indicating that the include directory order seems to matter for the generated files if there is some type of nesting amongst the directories.

Comments

  • benoit
    benoit Rennes, France
    Hi Caleb,

    Thanks for the report. This problem is actually already fixed on our mailine and the fix will be included in the upcoming Ice 3.2 version.

    The order should indeed not matter. The generated #include directive will be the one with the shortest path. See this FAQ for more details.

    Cheers,
    Benoit.