我正在使用 linux 4.20 和 ubuntu 15.10 虚拟机,我的主机是 windows 7。我正在尝试使用 Prismtech(社区版)提供的数据分发服务(DDS)协议实现一个简单的聊天消息示例。
我遇到了一个必须调用 Chat.idl 的教程。下面是文件中的代码,其中包含服务器和客户端之间互连的主体。
module Chat {
const long MAX_NAME = 32;
typedef string<MAX_NAME> nameType;
struct ChatMessage {
long userID; // owner of message
long index; // message number
string content; // message body
};
#pragma keylist ChatMessage userID
struct NameService {
long userID; // unique user identification
nameType name; // name of the user
};
#pragma keylist NameService userID
struct NamedMessage {
long userID; //unique user identification
nameType userName //user name
long index; //message number
string content; //message body
};
#pragma keylist NamedMessage userID
};
要调用它,我应该在我的命令行(终端)中输入“idlpp -S -lc Chat.idl”。下面是我的终端输出,显示“IDL 解析器错误:打开文件 chat.idl”。
-virtual-machine:~/HDE/x86.linux$ idlpp
Usage: idlpp [-c preprocessor-path] [-b ORB-template-path]
[-n <include-suffix>] [-I path] [-D macro[=definition]] [-S | -C]
[-l (c | c++ | cpp | isocpp | isoc++ | cs | java)] [-j [old]:<new>] [-d directory] [-i]
[-P dll_macro_name[,<h-file>]] [-o (dds-types | custom-psm | no-equality)] <filename>
akhil@akhil-virtual-machine:~/HDE/x86.linux$ idlpp -S -l c chat.idl
IDL parser error: opening file chat.idl