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

slice #include and scope rules

Im not sure what Im doing wrong.
#ifndef FILE1_ICE
#define FILE1_ICE
module Main{
  sequence<int> intOpt;
#ifndef FILE2_ICE
#define FILE2_ICE
#include <>
module Main{
module Group1{
  struct Pkt{
    Main::intOpt num;

I get an error saying "Main::intOpt is not defined".

Anyone know what it is I'm missing? (im sure it will be trivial :) )



  • I just tried this with
    slice2cpp -I.

    and it compiles without error. Can you post the command line you are using? Also, what compiler (slice2cpp, slice2java, etc) are you using, and on what platform?


  • My Bad

    Thank you for your help as it made look somewhere else and I found it.

    Had nothing to do with scope at all.

    It had all to do with my sloppy cut-and-paste, I had the same #ifndef on both files. i.e. #ifndef FILE1_ICE and in had ALSO #ifndef FILE1_ICE
    so the effect was that was never parsed.

    thanks again.