免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2613 | 回复: 6
打印 上一主题 下一主题

[故障求助] MAN也有错?odmcreate问题求教 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-03-18 22:52 |只看该作者 |倒序浏览
odmcreate的man手册中有这样一个example

Example

       Assuming that a ClassDescriptionFile file named FileName.cre exists, the following command creates object classes:

       odmcreate FileName.cre

       Below is the FileName.cre source file and the resulting .h file:

       /* This is an example odmcreate input file */
       /* FileName.cre */

              class Class2 {
                   char keys[32];
                   method card;
                   long cash;
                   };
             class TstObj {
                   long a;
                   char b[80];
                   link Class2 Class2 card Class2Ln;
                   };

       /* End of FileName.cre */

       /* This is the generated header file FileName.h */

       #include <odmi.h>

       struct Class2 {
            long _id;         /* unique object id within object class */
            long _reserved;   /* reserved field */
            long _scratch;    /* extra field for application use */
            char keys[32];
            char card[256];   /* method */
            long cash;
            };
       #define Class2_Descs 3

       extern struct Class Class2_CLASS[];
       #define get_Class2_list (a,b,c,d,e) (struct Class2 * ) odm_get_list (a,b,c,d,e)

       struct TstObj {
            long _id;         /* unique object id within object class */
            long _reserved;   /* reserved field */
            long _scratch;    /* extra field for application use */

            long a;
            char b[80];
            struct Class2 *Class2Ln;  /* link */
            struct objlistinfo *Class2Ln_info; /* link */
            char Class2Ln_Lvalue[256];        /* link */
            };
       #define TstObj_Descs 3

       extern struct Class TstObj_CLASS[];
       #define get_TstObj_list (a,b,c,d,e) (struct TstObj * ) odm_get_list (a,b,c,d,e)

       /* End of generated header file FileName.h */

       See "ODM Example Code and Output" in AIX Version 6.1 General Programming Concepts: Writing and Debugging Programs for another example of a
       ClassDescriptionFile parameter and the resulting .h file.

但执行odmcreate FileName.cre创建对象类的时候报错:
# odmcreate FileName.cre
0518-004 odmcreate: Incorrect descriptor type specified,
        line 12 in file FileName.cre. Specify a valid descriptor type.

说link Class2 Class2 card Class2Ln;这条语句指定了错误的描述符类型,应该是card的类型有问题。

哪位高手熟悉自定义odm对象类的,麻烦帮忙解释一下,非常感谢!

论坛徽章:
0
2 [报告]
发表于 2011-03-25 13:44 |只看该作者
是不是这个问题太简单了,大家都不屑回答啊?

论坛徽章:
0
3 [报告]
发表于 2011-03-25 14:42 |只看该作者
系统管理员不等于做系统编成....虽然有时也做点....ODM操作和系统的好多定义有关,一般不推荐你这样的操作,除非在实验室里面......生产环境麻烦多多啊.....建议你去找系统程序员....

论坛徽章:
0
4 [报告]
发表于 2011-03-28 09:27 |只看该作者
感谢版主回复,做系统管理或多或少都会涉及一些ODM库的操作,所以想仔细研究一下。对现有的对象类已经有一定认识,自己创建一个简单的对象类也没问题,但对man手册里这个example却摸不着头脑,测试机上可以随便搞。
anyway,还是谢谢版主回复,有机会找熟悉这方面的程序员问问。

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
5 [报告]
发表于 2011-03-28 10:39 |只看该作者
你link的都在吗?

论坛徽章:
0
6 [报告]
发表于 2011-03-28 12:39 |只看该作者
在,我把class2的定义单独拿出来先创建好对象类也不行。
感谢ls回复。

论坛徽章:
0
7 [报告]
发表于 2011-03-28 16:25 |只看该作者
建议lz找点资料对着做,developerwork里有很多,odm的customize还是比较简单的。。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP