Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-18-2008
Maverik888 Maverik888 is offline
Registered User
 
Name: Michael Lang
Organization: BA Friedrichshafen
Project: Distributed observation system
 
Join Date: Aug 2008
Posts: 5
Compiler problems with #include

Hello,

I have created an ICE structure in a module which I would like to use for an input and output parameter in an interface. The 'ice2java' compiler told me that the the specific struct does not exist -> 'PositionTime' is not defined

Her is my code:

1. The File with the structure: 'PositionTime.ice'

Code:
#ifndef POSITION_TIME_ICE
#define POSITION_TIME_ICE

/// 1. Module: calculators
module calculators {

	module generated {
	
		/// 1.1 Struct: PositionTime
		struct PositionTime {
		
			/// pointOfTime
			long pointOfTime;
		};
	};
};

#endif
2. Second code which uses the structure 'PositionTime'
\\File 2: Plain.ice

Code:
#ifndef PLAIN_ICE
#define PLAIN_ICE

#include <PositionTime.ice>

/// 2. File: Plain.ice

module plainPackage {

	module modelPackage {
	
		module generated {
	
			/// 1.1 Struct: AbsolutePlainPosition 
			struct AbsolutePlainPosition {
				
				/// absoluteDistance
				double absoluteDistance;
				/// latitude
				double latitude;
				/// longitude
				double longitude;		
			};
			
			interface Plain {
					
				idempotent PositionTime getStartTime();
				
				idempotent PositionTime getEndTime();
								
				idempotent AbsolutePlainPosition getCurrentPlainPosition(PositionTime positionTimeValue);
			};
		};
	};
};
#endif

3. The failure message:

Buildfile: D:\Diplomarbeit\Java_Workspace\Distributed_Observa tion_System\build.xml
slice2java:
[slice2java] slice2java --output-dir D:\Diplomarbeit\Java_Workspace\Distributed_Observa tion_System\generatedTargets -IC:\Programme\Ice-3.3.0\bin -ID:\Diplomarbeit\Java_Workspace\Distributed_Observ ation_System\modules\target D:\Diplomarbeit\Java_Workspace\Distributed_Observa tion_System\modules\target\Target.ice
[exec] D:/Diplomarbeit/Java_Workspace/Distributed_Observation_System/modules/target/Target.ice:50: `PositionTime' is not defined
[exec] D:/Diplomarbeit/Java_Workspace/Distributed_Observation_System/modules/target/Target.ice:52: `PositionTime' is not defined
[exec] D:/Diplomarbeit/Java_Workspace/Distributed_Observation_System/modules/target/Target.ice:60: `PositionTime' is not defined

BUILD FAILED
D:\Diplomarbeit\Java_Workspace\Distributed_Observa tion_System\build.xml:21: exec returned: 1

Total time: 312 milliseconds

These files are in the same directory. Finally when the names of the modules in the 'PositionTime.ice' file are the same as the modules in the file 'Plain.ice" file everythink works fine. But I would like to put the structure in a separate module, because it will be used from several classes.

Thanks,

Maverik888
Reply With Quote
  #2 (permalink)  
Old 08-18-2008
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,794
Since PositionTime is defined in a different module, you must use its fully qualified name, e.g.:

Code:
idempotent ::calculators::generated::PositionTime getStartTime();
Reply With Quote
  #3 (permalink)  
Old 08-18-2008
Maverik888 Maverik888 is offline
Registered User
 
Name: Michael Lang
Organization: BA Friedrichshafen
Project: Distributed observation system
 
Join Date: Aug 2008
Posts: 5
Thank you for that hint.

Now my airplanes can speak over the network

Tomorrow, I will create some sensor objects and I hope i can establish my first registry

Thanks,

Maverik888
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
slice2objc compiler slypete Bug Reports 2 05-04-2009 07:21 PM
Compiler error in Map.h Edwin Rodriguez Patches 1 05-01-2007 03:40 PM
CS: compiler warning DeepDiver Bug Reports 2 01-10-2005 07:31 PM
compiler error code Help Center 1 11-27-2004 03:36 PM
using Borland C++ Compiler Adanz Help Center 1 09-20-2004 09:20 PM


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


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