Results 1 to 4 of 4

Thread: Problem with include in slice2java

  1. #1
    Luis is offline Registered User
    Name: Luis Rosado
    Organization: Tecnobit
    Project: Remote Tracking System
    Join Date
    Jun 2009
    Posts
    4

    Problem with include in slice2java

    Hi everybody!

    I have a (perhaps stupid) problem: I have 2 slice files in the same directory: test1.ice and test2.ice

    Code:
    #ifndef TEST1
    #define TEST1
    module Tests
    {
    	struct Coordinate
    	{
    	    double x;
    	    double y;
    	    double z;
    	};
    };
    #endif
    Code:
    #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:

    Code:
    /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

  2. #2
    dwayne's Avatar
    dwayne is offline ZeroC Staff
    Name: Dwayne Boone
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Jan 2005
    Location
    St. John's, Newfoundland
    Posts
    397
    You need to add an include (-I) option so that slice2java knows where to look for included files. In your case you would use
    Code:
    slice2java -I. test2.ice

  3. #3
    Luis is offline Registered User
    Name: Luis Rosado
    Organization: Tecnobit
    Project: Remote Tracking System
    Join Date
    Jun 2009
    Posts
    4
    Thank you very much Dwayne!

  4. #4
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    If you use java with eclipse, I encourage you to use our Eclipse plugin. http://www.zeroc.com/eclipse.html

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 10-26-2006, 11:23 AM
  2. Python: #include/import problem with slice2py
    By hiasl in forum Bug Reports
    Replies: 1
    Last Post: 02-21-2006, 09:59 AM
  3. Question about #include
    By AlexKom in forum Help Center
    Replies: 3
    Last Post: 07-20-2005, 11:15 AM
  4. Slice2cpp Include Problem
    By tony_h in forum Help Center
    Replies: 4
    Last Post: 08-27-2004, 11:28 AM
  5. problem in C++ include file ordering
    By peter.s in forum Bug Reports
    Replies: 1
    Last Post: 03-26-2004, 04:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •