kyotocabinet.idl(23):错误MIDL2025:语法错误:期望接近“接口”的类型规范 [英] kyotocabinet.idl(23): error MIDL2025: syntax error : expecting a type specification near "interface"

查看:124
本文介绍了kyotocabinet.idl(23):错误MIDL2025:语法错误:期望接近“接口”的类型规范的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正在尝试编译一个应用程序而且我一直收到一个中止编译的错误。


这是错误:


1> .. \..\ ... \source\src\kyotocabinet\kyotocabinet.idl(23):错误MIDL2025:语法错误:期待类型规范靠近"接口"



因为我对编程知之甚少,(我现在只是修补编译) )我想得到一些关于如何修改程序中"违规"第23行的建议。


如果需要,以下是供您细读的整个文件。 







/ **

  ; *京都内阁的命名空间

  * /

模块kyotocabinet {

  // ------------------------------------------------ ----------------

  //预测

  // ------------------------------------------------ ----------------

 界面清单;

 界面地图;

 界面错误;

 界面访客;

 接口FileProcessor;

 界面记录器;

  interface Cursor;

 接口DB;

  // ------------------------------------------------ ----------------

  //字符串列表(由原生机制代替)

  // ------------------------------------------------ ----------------

 界面列表{
$
    string get(在长索引中);

  };
  // ------------------------------------------------ ----------------

  //字符串映射(由本机机制代替)

  // ------------------------------------------------ ----------------

 界面地图{

    string get(在字符串键中);

  };
  // ------------------------------------------------ ----------------

  //错误信息

  // ------------------------------------------------ ----------------

 界面错误{

    const long SUCCESS = 0;

    const long NOIMPL = 1;

    const long INVALID = 2;

    const long NOREPOS = 3;

    const long NOPERM = 4;

    const long BROKEN = 5;

    const long DUPREC = 6;

    const long NOREC = 7;

    const long LOGIC = 8;

    const long SYSTEM = 9;

    const long MISC = 15;

   长代码();

   字符串名称();

    string message();

  };
  // ------------------------------------------------ ----------------

  //记录访客

  // ------------------------------------------------ ----------------

 界面访客{

    const string NOP ="" ;;

    const string REMOVE ="" ;;

    string visit_full(在字符串键中,在字符串值中);

    string visit_empty(在字符串键中);

  };
  // ------------------------------------------------ ----------------

  //文件处理器

  // ------------------------------------------------ ----------------

 接口FileProcessor {

    boolean进程(在字符串路径中,长long计数,long long size);

  };
  // ------------------------------------------------ ----------------

  //事件记录器

  // ------------------------------------------------ ----------------

 界面记录器{

    const long INFO = 0;

    const long WARN = 1;

    const long ERROR = 2;

    void log(在字符串文件中,在长行中,在字符串中为func,在long类中,在字符串消息中);

  };
  // ------------------------------------------------ ----------------

  //元操作触发器

  // ------------------------------------------------ ----------------

 界面MetaTrigger {
$
    const long OPEN = 0;

    const long CLOSE = 1;

    const long CLEAR = 2;

    const long ITERATE = 3;

    const long SYNCHRONIZE = 4;

    const long OCCUPY = 5;

    const long BEGINTRAN = 6;

    const long COMMITTRAN = 7;

    const long ABORTTRAN = 8;

    const long MISC = 15;

    void trigger(长篇,在字符串消息中);

  };
  // ------------------------------------------------ ----------------

  //游标

  // ------------------------------------------------ ----------------

 界面光标{

    boolean accept(inout Visitor visitor,boolean writable,in boolean step);

    boolean set_value(在字符串值中,在布尔步骤中);

    boolean remove();

    string get_key(在布尔步骤中);

    string get_value(在布尔步骤中);

    boolean jump();

    boolean jump_(在字符串键中);

    boolean jump_back();

    boolean jump_back_(在字符串键中);

    boolean step();

    boolean step_back();

    DB db();

   错误错误();

  };
  // ------------------------------------------------ ----------------

  //常见的数据库操作

  // ------------------------------------------------ ----------------

  interface DB {

    const long OREADER = 1<< 0;

    const long OWRITER = 1<< 1;

    const long OCREATE = 1<< 2;
$
    const long OTRUNCATE = 1<< 3;
$
    const long OAUTOTRAN = 1<< 4;
$
    const long OAUTOSYNC = 1<< 5;
$
    const long ONOLOCK = 1<< 6;

    const long OTRYLOCK = 1<< 7;

    const long ONOREPAIR = 1<< 8;

   错误错误();

   布尔值打开(在字符串路径中,在长模式下);

    boolean close();

    boolean accept(在字符串键中,inout访问者访问者,以布尔值可写);

    boolean accept_bulk(在List键中,inout Visitor visitor,以boolean writable形式);

    boolean iterate(inout Visitor visitor,boolean writable);

    boolean scan_parallel(inout Visitor visitor,long thnum);

   布尔值集(在字符串键中,在字符串值中);

    boolean add(在字符串键中,在字符串值中);

    boolean replace(在字符串键中,在字符串值中);

    boolean append(在字符串键中,在字符串值中);

    long long increment(在字符串键中,在long long num中,在long long orig中);

    double increment_double(在字符串键中,在double num中,在double orig中);

    boolean cas(在字符串键中,在字符串椭圆形中,在字符串中为nval);

    boolean remove(在字符串键中);

    string get(在字符串键中);

   长检查(在字符串键中);

    string seize(在字符串键中);

    long long set_bulk(在Map recs中);

    long long remove_bulk(在列表键中);

   映射get_bulk(在列表键中);

    boolean clear();

    boolean synchronize(在boolean hard中,inout FileProcessor proc);

    boolean占用(在布尔值可写,inout FileProcessor proc中);

   布尔副本(在字符串dest中);

    boolean begin_transaction(以布尔值表示);

    boolean end_transaction(在布尔提交中);

    boolean dump_snapshot(在字符串dest中);

    boolean load_snapshot(在字符串src中);

    long long count();

    long long size();

    string path();

   地图状态();

   光标光标();

    boolean tune_logger(inout Logger logger);

    boolean tune_meta_trigger(inout MetaTrigger触发器);

  };
  // ------------------------------------------------ ----------------

  //原型哈希数据库

  // ------------------------------------------------ ----------------

 接口ProtoHashDB:DB {

  };
  // ------------------------------------------------ ----------------

  //原型树数据库

  // ------------------------------------------------ ----------------

 接口ProtoTreeDB:DB {

  };
  // ------------------------------------------------ ----------------

  //存储数据库

  // ------------------------------------------------ ----------------

 界面StashDB:DB {

    boolean tune_buckets(在long long bnum中);

  };
  // ------------------------------------------------ ----------------

  //缓存哈希数据库

  // ------------------------------------------------ ----------------

  interface CacheDB:DB {

    boolean tune_options(在长选项中);

    boolean tune_buckets(在long long bnum中);

    boolean cap_count(long long count);

    boolean cap_size(长很长);

  };
  // ------------------------------------------------ ----------------

  //缓存树数据库

  // ------------------------------------------------ ----------------

 界面GrassDB:DB {

    boolean tune_options(在长选项中);

    boolean tune_buckets(在long long bnum中);

    boolean tune_page(在长psiz中);

    boolean tune_page_cache(在long long pccap中);

  };
  // ------------------------------------------------ ----------------

  //文件哈希数据库

  // ------------------------------------------------ ----------------

 界面HashDB:DB {

    const long TSMALL = 1<< 0;

    const long TLINEAR = 1<< 1;

    const long TCOMPRESS = 1<< 2;
$
    boolean tune_alignment(long apow);

    boolean tune_fbp(在long fpow中);

    boolean tune_options(在长选项中);

    boolean tune_buckets(在long long bnum中);

    boolean tune_map(长long msiz);

    boolean tune_defrag(在长dfunit中);

  };
  // ------------------------------------------------ ----------------

  //文件树数据库

  // ------------------------------------------------ ----------------

 接口TreeDB:DB {

    const long TSMALL = 1<< 0;

    const long TLINEAR = 1<< 1;

    const long TCOMPRESS = 1<< 2;
$
    boolean tune_alignment(long apow);

    boolean tune_fbp(在long fpow中);

    boolean tune_options(在长选项中);

    boolean tune_buckets(在long long bnum中);

    boolean tune_page(在长psiz中);

    boolean tune_map(长long msiz);

    boolean tune_defrag(在长dfunit中);

    boolean tune_page_cache(在long long pccap中);

  };
  // ------------------------------------------------ ----------------

  //目录哈希数据库

  // ------------------------------------------------ ----------------

  interface DirDB:DB {

    const long TCOMPRESS = 1<< 2;
$
    boolean tune_options(在长选项中);

  };
  // ------------------------------------------------ ----------------

  //目录树数据库

  // ------------------------------------------------ ----------------

 接口ForestDB:DB {

    const long TCOMPRESS = 1<< 2;
$
    boolean tune_options(在长选项中);

    boolean tune_buckets(在long long bnum中);

    boolean tune_page(在长psiz中);

    boolean tune_page_cache(在long long pccap中);

  };
  // ------------------------------------------------ ----------------

  //多态数据库

  // ------------------------------------------------ ----------------

 接口PolyDB:DB {

   列出match_prefix(字符串前缀,long long max);

   列出match_regex(在字符串正则表达式中,在long long max中);

   列出match_similar(在字符串原点,在long long范围内,在boolean utf中,在long long max中);

  }
};



$


/ *文件结尾* /
$



解决方案

< blockquote>

您好Mig2004,


感谢您在此处发布。


>>我正在尝试编译应用程序并且我不断收到导致编辑中止的错误。


以下是错误:


1> .. \..\ ... \source\src\kyotocabinet\kyotocabinet.idl(23):错误MIDL2025:语法错误:期望类型规范靠近"interface"


您是否在项目中导入了idl文件?


请按照以下文档实施import语句。


https://msdn.microsoft。 com / zh-CN / library / windows / desktop / aa367048(v = vs.85).aspx


根据您的代码,我找不到确切的reaso n,特别是第23行。


你能告诉我们你如何调用这些接口吗?


这里有一些关于IDL文件的文件,也许是可以帮到你。


https://www.microsoft.com/msj/0898/idl/idl.aspx


https://msdn.microsoft.com/en-us/library/windows/desktop/aa367062(v = vs.85)。 aspx


最好的问候,


Sera Yu


Hello folks,

I'm trying to compile an application and I keep getting an error that aborts the compilation.

Here is the error:

1>..\..\...\source\src\kyotocabinet\kyotocabinet.idl(23): error MIDL2025: syntax error : expecting a type specification near "interface"

Since i dont know much about programming, (im just tinkering with compilation for now) I would like to get some suggestion on how to modify that 'offending' line 23 on the program.

Below is the whole file for your perusal, if needed. 



/**
 * namespace of Kyoto Cabinet
 */
module kyotocabinet {
  //----------------------------------------------------------------
  // prediction
  //----------------------------------------------------------------
  interface List;
  interface Map;
  interface Error;
  interface Visitor;
  interface FileProcessor;
  interface Logger;
  interface Cursor;
  interface DB;
  //----------------------------------------------------------------
  // list of strings (substituted by the native mechanism)
  //----------------------------------------------------------------
  interface List {
    string get(in long index);
  };
  //----------------------------------------------------------------
  // map of strings (substituted by the native mechanism)
  //----------------------------------------------------------------
  interface Map {
    string get(in string key);
  };
  //----------------------------------------------------------------
  // error information
  //----------------------------------------------------------------
  interface Error {
    const long SUCCESS = 0;
    const long NOIMPL = 1;
    const long INVALID = 2;
    const long NOREPOS = 3;
    const long NOPERM = 4;
    const long BROKEN = 5;
    const long DUPREC = 6;
    const long NOREC = 7;
    const long LOGIC = 8;
    const long SYSTEM = 9;
    const long MISC = 15;
    long code();
    string name();
    string message();
  };
  //----------------------------------------------------------------
  // record visitor
  //----------------------------------------------------------------
  interface Visitor {
    const string NOP = "";
    const string REMOVE = "";
    string visit_full(in string key, in string value);
    string visit_empty(in string key);
  };
  //----------------------------------------------------------------
  // file processor
  //----------------------------------------------------------------
  interface FileProcessor {
    boolean process(in string path, in long long count, in long long size);
  };
  //----------------------------------------------------------------
  // event logger
  //----------------------------------------------------------------
  interface Logger {
    const long INFO = 0;
    const long WARN = 1;
    const long ERROR = 2;
    void log(in string file, in long line, in string func, in long kind, in string message);
  };
  //----------------------------------------------------------------
  // meta operation trigger
  //----------------------------------------------------------------
  interface MetaTrigger {
    const long OPEN = 0;
    const long CLOSE = 1;
    const long CLEAR = 2;
    const long ITERATE = 3;
    const long SYNCHRONIZE = 4;
    const long OCCUPY = 5;
    const long BEGINTRAN = 6;
    const long COMMITTRAN = 7;
    const long ABORTTRAN = 8;
    const long MISC = 15;
    void trigger(in long kind, in string message);
  };
  //----------------------------------------------------------------
  // cursor
  //----------------------------------------------------------------
  interface Cursor {
    boolean accept(inout Visitor visitor, in boolean writable, in boolean step);
    boolean set_value(in string value, in boolean step);
    boolean remove();
    string get_key(in boolean step);
    string get_value(in boolean step);
    boolean jump();
    boolean jump_(in string key);
    boolean jump_back();
    boolean jump_back_(in string key);
    boolean step();
    boolean step_back();
    DB db();
    Error error();
  };
  //----------------------------------------------------------------
  // common database operations
  //----------------------------------------------------------------
  interface DB {
    const long OREADER = 1 << 0;
    const long OWRITER = 1 << 1;
    const long OCREATE = 1 << 2;
    const long OTRUNCATE = 1 << 3;
    const long OAUTOTRAN = 1 << 4;
    const long OAUTOSYNC = 1 << 5;
    const long ONOLOCK = 1 << 6;
    const long OTRYLOCK = 1 << 7;
    const long ONOREPAIR = 1 << 8;
    Error error();
    boolean open(in string path, in long mode);
    boolean close();
    boolean accept(in string key, inout Visitor visitor, in boolean writable);
    boolean accept_bulk(in List keys, inout Visitor visitor, in boolean writable);
    boolean iterate(inout Visitor visitor, in boolean writable);
    boolean scan_parallel(inout Visitor visitor, in long thnum);
    boolean set(in string key, in string value);
    boolean add(in string key, in string value);
    boolean replace(in string key, in string value);
    boolean append(in string key, in string value);
    long long increment(in string key, in long long num, in long long orig);
    double increment_double(in string key, in double num, in double orig);
    boolean cas(in string key, in string oval, in string nval);
    boolean remove(in string key);
    string get(in string key);
    long check(in string key);
    string seize(in string key);
    long long set_bulk(in Map recs);
    long long remove_bulk(in List keys);
    Map get_bulk(in List keys);
    boolean clear();
    boolean synchronize(in boolean hard, inout FileProcessor proc);
    boolean occupy(in boolean writable, inout FileProcessor proc);
    boolean copy(in string dest);
    boolean begin_transaction(in boolean hard);
    boolean end_transaction(in boolean commit);
    boolean dump_snapshot(in string dest);
    boolean load_snapshot(in string src);
    long long count();
    long long size();
    string path();
    Map status();
    Cursor cursor();
    boolean tune_logger(inout Logger logger);
    boolean tune_meta_trigger(inout MetaTrigger trigger);
  };
  //----------------------------------------------------------------
  // prototype hash database
  //----------------------------------------------------------------
  interface ProtoHashDB :DB {
  };
  //----------------------------------------------------------------
  // prototype tree database
  //----------------------------------------------------------------
  interface ProtoTreeDB :DB {
  };
  //----------------------------------------------------------------
  // stash database
  //----------------------------------------------------------------
  interface StashDB :DB {
    boolean tune_buckets(in long long bnum);
  };
  //----------------------------------------------------------------
  // cache hash database
  //----------------------------------------------------------------
  interface CacheDB :DB {
    boolean tune_options(in long opts);
    boolean tune_buckets(in long long bnum);
    boolean cap_count(in long long count);
    boolean cap_size(in long long size);
  };
  //----------------------------------------------------------------
  // cache tree database
  //----------------------------------------------------------------
  interface GrassDB :DB {
    boolean tune_options(in long opts);
    boolean tune_buckets(in long long bnum);
    boolean tune_page(in long psiz);
    boolean tune_page_cache(in long long pccap);
  };
  //----------------------------------------------------------------
  // file hash database
  //----------------------------------------------------------------
  interface HashDB :DB {
    const long TSMALL = 1 << 0;
    const long TLINEAR = 1 << 1;
    const long TCOMPRESS = 1 << 2;
    boolean tune_alignment(in long apow);
    boolean tune_fbp(in long fpow);
    boolean tune_options(in long opts);
    boolean tune_buckets(in long long bnum);
    boolean tune_map(in long long msiz);
    boolean tune_defrag(in long dfunit);
  };
  //----------------------------------------------------------------
  // file tree database
  //----------------------------------------------------------------
  interface TreeDB :DB {
    const long TSMALL = 1 << 0;
    const long TLINEAR = 1 << 1;
    const long TCOMPRESS = 1 << 2;
    boolean tune_alignment(in long apow);
    boolean tune_fbp(in long fpow);
    boolean tune_options(in long opts);
    boolean tune_buckets(in long long bnum);
    boolean tune_page(in long psiz);
    boolean tune_map(in long long msiz);
    boolean tune_defrag(in long dfunit);
    boolean tune_page_cache(in long long pccap);
  };
  //----------------------------------------------------------------
  // directory hash database
  //----------------------------------------------------------------
  interface DirDB :DB {
    const long TCOMPRESS = 1 << 2;
    boolean tune_options(in long opts);
  };
  //----------------------------------------------------------------
  // directory tree database
  //----------------------------------------------------------------
  interface ForestDB :DB {
    const long TCOMPRESS = 1 << 2;
    boolean tune_options(in long opts);
    boolean tune_buckets(in long long bnum);
    boolean tune_page(in long psiz);
    boolean tune_page_cache(in long long pccap);
  };
  //----------------------------------------------------------------
  // polymorphic database
  //----------------------------------------------------------------
  interface PolyDB :DB {
    List match_prefix(in string prefix, in long long max);
    List match_regex(in string regex, in long long max);
    List match_similar(in string origin, in long long range, in boolean utf, in long long max);
  };
};



/* END OF FILE */

解决方案

Hi Mig2004,

thanks for posting here.

>>I'm trying to compile an application and I keep getting an error that aborts the compilation.

Here is the error:

1>..\..\...\source\src\kyotocabinet\kyotocabinet.idl(23): error MIDL2025: syntax error : expecting a type specification near "interface"

Have you imported your idl file in your project?

Follow the document below to implement the import statement.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa367048(v=vs.85).aspx

According to your code, I couldn't find the exact reason, especially on line 23.

Could you please show us how you call these interfaces?

Here are some documents about IDL files, maybe it could be help of you.

https://www.microsoft.com/msj/0898/idl/idl.aspx

https://msdn.microsoft.com/en-us/library/windows/desktop/aa367062(v=vs.85).aspx

Best Regards,

Sera Yu


这篇关于kyotocabinet.idl(23):错误MIDL2025:语法错误:期望接近“接口”的类型规范的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆