Home Help Center

Compiler problems with #include

Maverik888Maverik888 Member Michael LangOrganization: BA FriedrichshafenProject: Distributed observation system

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'

/// 1. Module: calculators
module calculators {

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


2. Second code which uses the structure 'PositionTime'
\\File 2: Plain.ice
#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);

3. The failure message:

Buildfile: D:\Diplomarbeit\Java_Workspace\Distributed_Observation_System\build.xml
[slice2java] slice2java --output-dir D:\Diplomarbeit\Java_Workspace\Distributed_Observation_System\generatedTargets -IC:\Programme\Ice-3.3.0\bin -ID:\Diplomarbeit\Java_Workspace\Distributed_Observation_System\modules\target D:\Diplomarbeit\Java_Workspace\Distributed_Observation_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

D:\Diplomarbeit\Java_Workspace\Distributed_Observation_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.




  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Since PositionTime is defined in a different module, you must use its fully qualified name, e.g.:
    idempotent ::calculators::generated::PositionTime getStartTime();
  • Maverik888Maverik888 Member Michael LangOrganization: BA FriedrichshafenProject: Distributed observation system
    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


Sign In or Register to comment.