Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 11-28-2005
sac_urs sac_urs is offline
Registered User
 
 
Join Date: Nov 2005
Posts: 10
The ice include path...

hi,

i have question regarding including the ice files.

suppose i have a ice file... a.ice

module X {
module Y {
interface Z {
void doSomething(int x, int y);
};
};
};

and if i have a ice file b.ice in the same directory:

#include "a.ice"

module D {
module E {
interface F implements ::X::Y::Z {
void doSomething(int x, int y);
};
};
};


this does not work.

how do i include a sice file into another sice file
__________________
Sac Urs
sac_urs@yahoo.co.in
Programmer - Informedia.
No URL ATM
Reply With Quote
  #2 (permalink)  
Old 11-28-2005
sac_urs sac_urs is offline
Registered User
 
 
Join Date: Nov 2005
Posts: 10
The Ice include path

and one more note on that,

if i do slice2py, it compiles.
and it does not work when i do Ice.loadSlice(path_to_icefile).

thanks,
__________________
Sac Urs
sac_urs@yahoo.co.in
Programmer - Informedia.
No URL ATM
Reply With Quote
  #3 (permalink)  
Old 11-28-2005
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,540
Hi,

If Ice.loadSlice call is failing, could you cut and paste the error you're seeing when you run the python script? Note that you might need to specify the --all option when loading your Ice file (unless you have already generated definitions for the a.ice included file). For example:

Code:
  Ice.loadSlice("--all file.ice")
Benoit.
Reply With Quote
  #4 (permalink)  
Old 11-28-2005
sac_urs sac_urs is offline
Registered User
 
 
Join Date: Nov 2005
Posts: 10
The ice include path

hi here is the complete description of the problem:

i have a ice file called category.ice in /opt/prh/prhPC/ice/prhice/ directory.
in the same directory i have another file called utils.ice, which contains common code that would be present in all the ice files.

so i do,

#include "utils.ice" in all the files, so that i could use that common method getRowCount() every ice module without having to rewrite many times.

but when i do a Ice.loadSlice("--all /opt/prh/....") , I get the following error.



Traceback (most recent call last):
File "categoryclient.py", line 6, in ?
Ice.loadTraceback (most recent call last):
File "categoryclient.py", line 6, in ?
Ice.loadSlice('/opt/prh/prhPC/ice/prhice/category.ice')
File "/opt/prh/prhPC/ice/prhice/category.ice", line 3, in ?

ImportError: No module named _opt_prh_prhPC_ice_prhice_utils_ice
Slice('/opt/prh/prhPC/ice/prhice/category.ice')
File "/opt/prh/prhPC/ice/prhice/category.ice", line 3, in ?

ImportError: No module named _opt_prh_prhPC_ice_prhice_utils_ice


thanks,
__________________
Sac Urs
sac_urs@yahoo.co.in
Programmer - Informedia.
No URL ATM
Reply With Quote
  #5 (permalink)  
Old 11-28-2005
benoit's Avatar
benoit benoit is offline
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,540
It looks like Ice.loadSlice is not properly handling files included with #include "" (instead of #include <>). You should be able to work around this problem by using the following command instead:

Code:
   Ice.loadSlice("--all -I/opt/prh/prhPC/ice/prhice /opt/prh/prhPC/ice/prhice/category.ice")
Benoit.
Reply With Quote
  #6 (permalink)  
Old 11-28-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Quote:
Originally Posted by sac_urs
but when i do a Ice.loadSlice("--all /opt/prh/....") , I get the following error.

Traceback (most recent call last):
File "categoryclient.py", line 6, in ?
Ice.loadSlice('/opt/prh/prhPC/ice/prhice/category.ice')
File "/opt/prh/prhPC/ice/prhice/category.ice", line 3, in ?

ImportError: No module named _opt_prh_prhPC_ice_prhice_utils_ice
Slice('/opt/prh/prhPC/ice/prhice/category.ice')
File "/opt/prh/prhPC/ice/prhice/category.ice", line 3, in ?
As Benoit mentioned, you need to include the '--all' option, otherwise the extension expects to find a statically-generated module for utils.ice (see section 22.15 in the manual).

Take care,
- Mark
Reply With Quote
  #7 (permalink)  
Old 11-29-2005
sac_urs sac_urs is offline
Registered User
 
 
Join Date: Nov 2005
Posts: 10
hi,

the --all flag is working,
thanks for the reply.

thanks,
__________________
Sac Urs
sac_urs@yahoo.co.in
Programmer - Informedia.
No URL ATM
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
slice2cpp and absolute path DeepDiver Bug Reports 2 10-25-2005 09:30 PM
Slice Include Path aerowyn Help Center 2 10-17-2005 05:16 PM
Path #1 for Ice 2.1.1, all languages michi Patches 0 06-08-2005 03:06 AM
Slice Path Jennie Help Center 2 11-18-2004 06:10 PM
slice2freeze generating include path is error dragzhb Bug Reports 2 09-12-2004 10:55 PM


All times are GMT -4. The time now is 10:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.