Home Help Center

slice #include and scope rules

alfredtalfredt Member Alfred TasconOrganization: NoneProject: None
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 <File1.ice>
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 :) )



  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    I just tried this with
    slice2cpp -I. File2.ice

    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?


  • alfredtalfredt Member Alfred TasconOrganization: NoneProject: None
    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 file2.ice had ALSO #ifndef FILE1_ICE
    so the effect was that file1.ice was never parsed.

    thanks again.
Sign In or Register to comment.