Archived

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

Slice2cpp question

Hello,

I have two slice class-definitions. In class1 I include the ice-file of the second class. This definition looks like the following:

#include "Class1.ice"

class Class2
{
...
}

I compile the definition-files with the following syntax:

slice2cpp Class1.ice --header-ext hxx --source-ext cxx
slice2cpp Class2.ice --header-ext hxx --source-ext cxx

The problem lies in the generated header file of class2:

// Ice version 1.2.0
// Generated from file `Class2.ice'

#include <Ice/LocalObjectF.h>
#include <Ice/ProxyF.h>
...
#include <Ice/Direct.h>
#include <Class1.h> --> this should be <Class1.hxx>
...

What can I do to avoid changing the generated header file manually everytime I ran slice2cpp?

Thanks in advance.

Comments

  • mes
    mes California
    Hi,

    This is a known bug which has been fixed for the next release. You can fix it easily by editing src/slice2cpp/Gen.cpp and changing line 227 from the following:
          H << "\n#include <" << changeInclude(*q, _includePaths) << ".h>";
    
    to this:
          H << "\n#include <" << changeInclude(*q, _includePaths) << "." << _headerExtension << ">";
    
    Then rebuild the translator.

    Take care,
    - Mark