Home Help Center

icecpp and relative paths

CraigCraig Member Craig BachelorOrganization: MyBoatProject: Yacht Electronics Automation/Integration
Hi. Should

icecpp.exe ..\foo.ice

work as expected on Windows?

In cccp.c::base_name, the backslash is not detected as a path separator, which ultimately causes preprocessing of one of my files to fail. I recompiled icecpp.exe with DIR_SEPARATOR defined to '\\' and things worked as expected. This was manifested when foo.ice contained a relative path #include.

Thanks,
Craig

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Our Slice compilers (slice2cpp, slice2java, etc.) translate all backslashes to forward slashes before they call icecpp. You should not call icecpp directly.

    Note that icecpp is simply the GNU C preprocessor. It is included in the Ice distribution for convenience.
  • CraigCraig Member Craig BachelorOrganization: MyBoatProject: Yacht Electronics Automation/Integration
    Hmmm. Well slice2py doesn't seem to be. I'll look into that further. I wasn't calling icecpp directly, but I ended up there tracing the problem.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    I forgot to mention: In Slice files, you must use the forward slash for #include statements. Backslashes in Slice #include statements do not work. (I guess our documentation has to be modified to point this out.)

    However, for pathnames passed to slice2xxx, both forward and backslashes should work. Backslashes are then translated to forward slashes before such paths are passed to icecpp.
  • CraigCraig Member Craig BachelorOrganization: MyBoatProject: Yacht Electronics Automation/Integration
    I actually am using / in the include statement. I just stepped through the Ice-3.2.1 slice2py.exe::main function and there doesn't appear to be any \ -> / translation. In any case, icecpp is definitely being passed a \
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Seems to be a bug then... thanks for the report!
Sign In or Register to comment.