Archived
This forum has been archived. Please start a new discussion on GitHub.
Problem with include in slice2java
in Help Center
Hi everybody!
I have a (perhaps stupid) problem: I have 2 slice files in the same directory: test1.ice and test2.ice
I can make "slice2java test1.ice" and it works and generate the java source files under the Tests folder but "slice2java test2.ice" doesn't work and also shows this message:
What is the problem? And what should I change if the "included" slices are from other folder or from other ice module?
Thank you in advance for your help
Luis
I have a (perhaps stupid) problem: I have 2 slice files in the same directory: test1.ice and test2.ice
#ifndef TEST1 #define TEST1 module Tests { struct Coordinate { double x; double y; double z; }; }; #endif
#ifndef TEST2 #define TEST2 #include <test1.ice> module Tests { interface RemoteTrackingSystem { Coordinate getLocation(string identifier); }; }; #endif
I can make "slice2java test1.ice" and it works and generate the java source files under the Tests folder but "slice2java test2.ice" doesn't work and also shows this message:
/home/luis/IceTests/SLICE/test2.ice:4: error: Can't open include file "test1.ice" #include <test1.ice> 1 error in preprocessor.
What is the problem? And what should I change if the "included" slices are from other folder or from other ice module?
Thank you in advance for your help
Luis
0
Comments
-
You need to add an include (-I) option so that slice2java knows where to look for included files. In your case you would use
slice2java -I. test2.ice
0 -
Thank you very much Dwayne!
0 -
If you use java with eclipse, I encourage you to use our Eclipse plugin. http://www.zeroc.com/eclipse.html0