关于extreme sports的作文_grantable

关于extreme sports的作文_grantable尊敬的前辈,    大家好!    我在网上看到了关于extremedb的文章,在实际操作时碰到了一些问题,想和大家探讨一下。1、我先安装了extremedb_3.1_win32_sql_log_eval_1B.EXE,2、然后用安装目录(C:/McObject/eXtremeDB_SQL_LOG/win32/host/bin)下的mcocomp.exe对test.mco文件进行了

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

尊敬的前辈,
    大家好!
    我在网上看到了关于extremedb的文章,在实际操作时碰到了一些问题,想和大家探讨一下。
1、我先安装了extremedb_3.1_win32_sql_log_eval_1B.EXE,
2、然后用安装目录(C:/McObject/eXtremeDB_SQL_LOG/win32/host/bin)下的mcocomp.exe对test.mco文件进行了编译,test.mco文件代码如下:
#define int1 signed<1>

#define int2 signed<2>

#define int4 signed<4>

#define int8 signed<8>

#define uint8 unsigned<8>

#define uint4 unsigned<4>

#define uint2 unsigned<2>

#define uint1 unsigned<1>

declare database testdb;  //申明一个数据库定义名称

compact class Myclass     //表名字

{

  unsigned<4> id;

  char<20> strnname;

  string straddress;

  unique tree<id> pkey;    //索引

};
3、编译成功后生成了如下两个文件:testdb.c,testdb.h
testdb.c的代码如下:
/* Generated by eXtremeDB Schema Compiler, build 468

 * at Fri Jul 31 09:44:42 2009

 */
#include “testdb.h”

#include “mcowrap.h”

/*———————————————————————*/

/* dictionary                                                          */
mco_dictionary_h testdb_get_dictionary(void)

{

  static mco_dictionary_t  dict;

  static int dictionary_ready = 0;
  if( ! dictionary_ready )

  {

    static mco_dict_field_t v_field_info[3] = {

    /* Myclass */

    {“id”, {4, 4, 0, 4, 4, 0}, 3, 8, 0, -1, 4, -1, 0, 0, -1,  0 /* 1 */},

    {“straddress”, {2, 2, 4, 4, 4, 4}, 8, 0, 0, -1, 0, -1, 0, 2, -1,  0 /* 3 */},

    {“strnname”, {20, 1, 6, 20, 1, 8}, 7, 0, 0, -1, 20, -1, 0, 1, -1,  0 /* 2 */}

    };
    static mco_dict_struct_t v_struct_info[1] = {

    { “Myclass”, 1, 3, (v_field_info + 0), 26, 4, 28, 4 }

    };
    dictionary_ready = 1;
    {

      static const char * v_class_names[] =

      {

        0,

        “Myclass”     , /* [1] */

        0

      };
      dict.str_class_names = v_class_names;

    }

    {

      static const char * v_index_names[] =

      {

        “Myclass.pkey”     , /* [0] */

        0

      };
      dict.str_index_names = v_index_names;

    }
    {

      static  mco_dict_class_info_t class_inf[2] = {

        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },

        { 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, -2, 8, (v_struct_info + 0), 26, 0, -1, -1, -1 }  /* Myclass */

      };

      dict.v_class_info = class_inf;

    }

    dict.v_desc_events = (mco_dict_event_t *)0;

   
    dict.v_all_struct = v_struct_info;

    {

      static mco_dict_index_field_t v_all_index_fields[ 1] = {

          { 0, -1, 4, 3, 0, 1 } /* [0] id */

      };
      static mco_dict_index_t v_all_indexes_info[ 1] = {

          { 1, 1, -1, 2051, & v_all_index_fields[0], 0 } /* Myclass.pkey [0] */

      };
      dict.v_desc_indexes = v_all_indexes_info;

    }
    dict.version_major             = 3;

    dict.version_minor             = 1;

    dict.version_build             = 468;

    dict.magic_number              = 7;

    dict.oid_is_supported          = 0;

    dict.auto_oid_supported        = 0;

    dict.flags                     = 0;

    dict.n_class_codes             = 1;

    dict.n_list_indexes            = 0;

    dict.n_autoid_indexes          = 0;

    dict.n_history_indexes         = 0;

    dict.n_desc_indexes            = 1;

    dict.n_desc_events             = 0;

    dict.n_structs                 = 1;

    dict.num_oid_estimation        = 0;

    dict.num_HA_estimation         = 0;

    dict.max_numof_indexes_per_obj = 1;

    dict.exact_OID_sizeof          = 0;

    dict.layout_OID_size           = 0;

  }
  return &dict;

}
MCO_RET  Myclass_new                           ( mco_trans_h t, /*OUT*/ Myclass *handle )

{ return mco_w_new_obj_noid( t, 26, 1, (mco_objhandle_h)handle);

}
MCO_RET  Myclass_delete                        ( Myclass *handle )

{ return mco_w_obj_delete( (mco_objhandle_h)handle);

}
MCO_RET  Myclass_delete_all                    ( mco_trans_h t )

{ return mco_w_obj_delete_all( t, 1 );

}
MCO_RET  Myclass_checkpoint                    ( Myclass *handle )

{ return mco_w_obj_checkpoint( (mco_objhandle_h)handle );

}
MCO_RET  Myclass_pack                          ( Myclass *handle, /*OUT*/ uint4 * pages_released )

{ return mco_w_compact( (mco_objhandle_h)handle, 1, 0, pages_released);

}
MCO_RET  Myclass_id_get                        ( Myclass *handle, /*OUT*/ uint4 * result)

{ return mco_w_b4_get( (mco_objhandle_h) handle, 0, result);

}
MCO_RET  Myclass_id_put                        ( Myclass *handle, uint4 value )

{ return mco_w_b4_put( (mco_objhandle_h) handle, 0, 1, *(uint4*)& value);

}
MCO_RET  Myclass_strnname_get                  ( Myclass *handle, /*OUT*/ char * dest, uint2 dest_size)

{ return mco_w_chars_get2( (mco_objhandle_h) handle, 8, 6, dest, dest_size, 20);

}
MCO_RET  Myclass_strnname_put                  ( Myclass *handle, const char * src, uint2 len)

{ return mco_w_chars_put2( (mco_objhandle_h)handle, 8, 6, src, len, 20, 0);

}
MCO_RET  Myclass_straddress_get                ( Myclass *handle, /*OUT*/ char * dest, uint2 dest_size, /*OUT*/ uint2 * len)

{ return mco_w_string_get2( (mco_objhandle_h) handle, 4, 4, dest, dest_size, len);

}
MCO_RET  Myclass_straddress_size               ( Myclass *handle, /*OUT*/ uint2 *result)

{ return mco_w_string_len2( (mco_objhandle_h) handle, 4, 4, result);

}
MCO_RET  Myclass_straddress_put                ( Myclass *handle, const char * src, uint2 len)

{ return mco_w_string_put2( (mco_objhandle_h) handle, 4, 4, src, len, 0);

}
MCO_RET  Myclass_from_cursor                   ( mco_trans_h t, mco_cursor_h c, /*OUT*/ Myclass *handle )

{ return mco_w_obj_from_cursor( t, c, 1, (mco_objhandle_h)handle );

}
MCO_RET  Myclass_pkey_index_cursor             ( mco_trans_h t, /*OUT*/ mco_cursor_h c )

{ return mco_w_index_cursor( t, 0, c );

}
MCO_RET  Myclass_pkey_search                   ( mco_trans_h t, /*INOUT*/ mco_cursor_h c, MCO_OPCODE op_, uint4 id )

{ mco_external_field_t a_ [1];

  mco_external_field_h pa_ = a_;

  pa_->field_type = 3; pa_->v.u4 = id;
  return mco_w_tree_find(t,c,op_,a_);

}
MCO_RET  Myclass_pkey_compare                  ( mco_trans_h t, mco_cursor_h c, uint4 id, /*OUT*/ int *result_ )

{ mco_external_field_t a_[1];

  mco_external_field_h pa_ = a_;

  pa_->field_type = 3; pa_->v.u4 = id;

  return mco_w_cursor_compare( t, c, a_, result_);

}
MCO_RET  Myclass_pkey_pattern_size            ( uint4 id, /*OUT*/ uint4 *size_)

{ mco_external_field_t a_ [2];

  mco_external_field_h pa_ = a_;

  pa_->field_type = 3; pa_->v.u4 = id;

  (pa_+1)->field_type=0;

  *size_=mco_w_pattern_size(0, a_);

  return MCO_S_OK;

}
MCO_RET  Myclass_pkey_pattern_search           ( mco_trans_h t, /*INOUT*/ void *allocated_pattern, uint4 memsize, /*OUT*/ Myclass *obj, uint4 id )

{ mco_external_field_t a_ [2];

  mco_external_field_h pa_ = a_;

  pa_->field_type = 3; pa_->v.u4 = id;

  (pa_+1)->field_type=0;

  return mco_w_pattern_search(t, 0, allocated_pattern, memsize, (mco_objhandle_h )obj, a_);

}
MCO_RET  Myclass_pkey_pattern_next             ( mco_trans_h t, /*INOUT*/ void *allocated_pattern, /*OUT*/ Myclass *obj)

{ return mco_w_pattern_next(t, 0 , allocated_pattern, (mco_objhandle_h) obj, 0);

}
MCO_RET  Myclass_pkey_locate                   ( mco_trans_h t, /*OUT*/ mco_cursor_h c, Myclass * handle)

{ return mco_w_cursor_locate( t, 0, (mco_objhandle_h)handle, c);

}
MCO_RET  Myclass_pkey_find                     ( mco_trans_h t, uint4 id, /*OUT*/ Myclass *handle_)

{ mco_external_field_t a_[1];

  mco_external_field_h pa_ = a_;

  pa_->field_type = 3; pa_->v.u4 = id;

  return mco_w_tree_find_scalar(t, 0, a_, (mco_objhandle_h)handle_);

}
testdb.h的代码如下:
/* Generated by eXtremeDB Schema Compiler, build 468

 * at Fri Jul 31 09:44:42 2009

 */
#ifndef __MCO__testdb__H__

#define __MCO__testdb__H__
#ifndef MCO_CFG_WCHAR_SUPPORT

#define MCO_CFG_WCHAR_SUPPORT

#include <wchar.h>

#endif
#ifdef __cplusplus

extern “C” {

#endif
#include “mco.h”
#define MCO_COMP_VER_MAJOR 3

#define MCO_COMP_VER_MINOR 1

#define MCO_COMP_BUILD_NUM 468
 
/*———————————————————————*/

/* Handles and Class Codes                                             */
typedef struct Myclass_    { MCO_Hf h; }  Myclass;

#define                                   Myclass_code     1
 
/*———————————————————————*/

/* Dictionary                                                          */
mco_dictionary_h testdb_get_dictionary(void);

/*———————————————————————*/

/* class Myclass methods                                               */
MCO_RET  Myclass_new                           ( mco_trans_h t, /*OUT*/ Myclass *handle );

MCO_RET  Myclass_delete                        ( Myclass *handle );

MCO_RET  Myclass_delete_all                    ( mco_trans_h t );

MCO_RET  Myclass_checkpoint                    ( Myclass *handle );

MCO_RET  Myclass_pack                          ( Myclass *handle, /*OUT*/ uint4 * pages_released );
MCO_RET  Myclass_id_get                        ( Myclass *handle, /*OUT*/ uint4 * result);

MCO_RET  Myclass_id_put                        ( Myclass *handle, uint4 value );
MCO_RET  Myclass_strnname_get                  ( Myclass *handle, /*OUT*/ char * dest, uint2 dest_size);

MCO_RET  Myclass_strnname_put                  ( Myclass *handle, const char * src, uint2 len) ;
MCO_RET  Myclass_straddress_get                ( Myclass *handle, /*OUT*/ char * dest, uint2 dest_size, /*OUT*/ uint2 * len);

MCO_RET  Myclass_straddress_size               ( Myclass *handle, /*OUT*/ uint2 *result);

MCO_RET  Myclass_straddress_put                ( Myclass *handle, const char * src, uint2 len);
MCO_RET  Myclass_from_cursor                   ( mco_trans_h t, mco_cursor_h c, /*OUT*/ Myclass *handle );
MCO_RET  Myclass_pkey_index_cursor             ( mco_trans_h t, /*OUT*/ mco_cursor_h c );

MCO_RET  Myclass_pkey_search                   ( mco_trans_h t, /*INOUT*/ mco_cursor_h c, MCO_OPCODE op_, uint4 id );

MCO_RET  Myclass_pkey_compare                  ( mco_trans_h t, mco_cursor_h c, uint4 id, /*OUT*/ int *result_ );

MCO_RET  Myclass_pkey_pattern_size            ( uint4 id, /*OUT*/ uint4 *size_);

MCO_RET  Myclass_pkey_pattern_search           ( mco_trans_h t, /*INOUT*/ void *allocated_pattern, uint4 memsize, /*OUT*/ Myclass *obj, uint4 id );

MCO_RET  Myclass_pkey_pattern_next             ( mco_trans_h t, /*INOUT*/ void *allocated_pattern, /*OUT*/ Myclass *obj);

MCO_RET  Myclass_pkey_locate                   ( mco_trans_h t, /*OUT*/ mco_cursor_h c, Myclass * handle);

MCO_RET  Myclass_pkey_find                     ( mco_trans_h t, uint4 id, /*OUT*/ Myclass *handle_);
#ifdef __cplusplus

} // extern “C”

#endif
#endif

4、然后用VC++6.0新建了一个工程Myproject,并把testdb.c,testdb.h拷到了该工程目录下,然后将testdb.c,testdb.h加入到该工程
5、接着设置了Myproject,
(1)在project/setting中选择link,将category选为general,在其后加入mcolib_shm.lib,并将mcolib_shm.lib拷到Myproject目录中
(2)在project/setting中选择C/C++,将category选为code generation,
将use run-time library选为debug multithreaded dll
6、新建一个源文件Mytest.c,代码如下:
#include<ctype.h>

#include<stdlib.h>

#include<stdio.h>

#include<string.h>

#include “testdb.h”

const char *dbname=”demo ShmDb”;

const int SEGSZ=1024*1024*10;

const uint2 PAGESIZE=90;

const int MAP_ADDRESS=0x200000000;

void SH(void)

{

 char test[]={“嵌入式实时数据库演示/n”};

 char text1[]={“Copyright(c)2001-2005 Mcobject LLC.All Right Reserved./n”};

 printf(“%s/n eXtremeDB runtime version %d.%d,build %d/n %s/n/n Press Enter to Start”,text,MCO_COMP_VER_MAJOR,MCO_COMP_VER_MINOR,MCO_COMP_BUILD_NUM,text1);

 getchar();

}

static int askNumber(const char *prompt)

{

 char buf[100];

 printf(“/n%s”,prompt);

 fgets(buf,sizeof(buf),stdin);

 if(isdigit(buf[0]))

  return atoi(buf);

 return -1;

}

static char *askString(const char *prompt)

{

 char buf[300];

 static char buf1[300];

 printf(“/n%s”,prompt);

}
7、然后编译,提示错误:
——————–Configuration: Myproject – Win32 Debug——————–

Compiling…

Mytest.c

C:/123/Myproject/Mytest.c(9) : warning C4305: ‘initializing’ : truncation from ‘const __int64 ‘ to ‘const int ‘

C:/123/Myproject/Mytest.c(28) : warning C4101: ‘buf’ : unreferenced local variable

Linking…

LINK : warning LNK4098: defaultlib “MSVCRT” conflicts with use of other libs; use /NODEFAULTLIB:library

MSVCRTD.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main

Debug/Myproject.exe : fatal error LNK1120: 1 unresolved externals

执行 link.exe 时出错.
Myproject.exe – 1 error(s), 0 warning(s)

 
小结:我估计是Mytest.c写得不完整,这个代码是在一个帖子里看到的,里面没有main函数。
    请问大家能能写出一个完整的Mytest.c吗?然后给我发过来吗?我现在水平有限,目前只能照搬别人的代码,只是想先按照提示做出点东西。
    期待着大家的回复!谢谢了!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/181980.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • Oracle创建表空间、创建用户的完整过程「建议收藏」

    Oracle创建表空间、创建用户的完整过程「建议收藏」我在工作学习过程中经常用到Oracle,由于经验欠缺,熟练度不足,每次都要百度一下。现在总结一下Oracle创建用户的过程,分享给大家。这里我就直接把sql语句贴出来,使用时直接复制粘贴即可。/*步骤:1、创建表空间2、创建用户3、用户授权*//*创建表空间*/createtablespaceQCJ_TABLESPACE…

  • having 用法

    having 用法SELECTfee.bank_code,COUNT(1)cFROMt_fp_feefeeWHEREfee.fcd>=DATE’2019-6-13’GROUPBYfee.bank_codeHAVINGCOUNT(1)>=1000注意COUNT(1)不能改为C,不能使用别名…

  • Springboot自动装配的原理「建议收藏」

    Springboot自动装配的原理「建议收藏」springboot在日常开发中减少了我们许多工作量减少了很多XML配置,这都得益于springboot自动装配的特性。那么springboot是如何实现自动装配的呢?首先我们浅显得介绍一些springboot的一些主要注解:@Configuration用于声明定义bean这也是springboot中的主要注解其实就是平常Spring配置文件中我们写的bean@EnableAutoConfiguration用来开启springboot自动配置的注解,这个也是自动装…

  • yate.conf

    yate.conf

  • Python 输出对齐「建议收藏」

    Python 输出对齐「建议收藏」往往要对输出内容进行对齐,看起来更清爽。python中对齐有两种方式。第一种是用格式符,如下:s1=’longlonglong.’s2=’short.’print(‘%-30s%-20s’%(s1,s2))#’%-30s’含义是左对齐,且占用30个字符位print(‘%-30s%-20s’%(s2,s1))longlonglong….

    2022年10月30日
  • mse均方误差例题_误差函数计算器

    mse均方误差例题_误差函数计算器文章目录背景函数代码调用方法调用测试函数背景本人最近需要写多个仿真,需要大量用到MSE(均方误差)计算,于是干脆将MSE运算封装为函数,后续使用直接进行调用即可。函数代码%Project:均方误差函数%Author:Jace%Data:2021/11/01%====================函数体====================function[MSE]=MSE(Dim,Step,N,xkf,x)%====================分配空间=======

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号