编译libkml-1.3.0报错:minizip/crypt.h:没有那个文件或目录

完整的报错信息如下:/root/libkml-1.3.0/src/kml/base/contrib/minizip/unzip.c:183:10: 致命错误:minizip/crypt.h:没有那个文件或目录
 #include <minizip/crypt.h>
          ^~~~~~~~~~~~~~~~~
编译中断。

原因分析:yum install minizip-devel,如果安装的是minizip-devel-1.2.7-21.el7_9.aarch64,则不存在这个问题。如果安装的是minizip-devel-1.2.11-18.ky10.aarch64,则/usr/include/minizip路径下缺失crypt.h。

解决办法,新建一个crypt.h,输入以下内容,然后复制到usr/include/minizip路径下

/* crypt.h -- base code for crypt/uncrypt ZIPfile


   Version 1.01e, February 12th, 2005

   Copyright (C) 1998-2005 Gilles Vollant

   This code is a modified version of crypting code in Infozip distribution

   The encryption/decryption parts of this source code (as opposed to the
   non-echoing password parts) were originally written in Europe.  The
   whole source package can be freely distributed, including from the USA.
   (Prior to January 2000, re-export from the US was a violation of US law.)

   This encryption code is a direct transcription of the algorithm from
   Roger Schlafly, described by Phil Katz in the file appnote.txt.  This
   file (appnote.txt) is distributed with the PKZIP program (even in the
   version without encryption capabilities).

   If you don't need crypting in your application, just define symbols
   NOCRYPT and NOUNCRYPT.

   This code support the "Traditional PKWARE Encryption".

   The new AES encryption added on Zip format by Winzip (see the page
   http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
   Encryption is not supported.
*/

#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))

/***********************************************************************
 * Return the next byte in the pseudo-random sequence
 */
static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
{
    unsigned temp;  /* POTENTIAL BUG:  temp*(temp^1) may overflow in an
                     * unpredictable manner on 16-bit systems; not a problem
                     * with any known compiler so far, though */

    temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
    return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
}

/***********************************************************************
 * Update the encryption keys with the next byte of plain text
 */
static int update_keys(unsigned long* pkeys,const z_crc_t* pcrc_32_tab,int c)
{
    (*(pkeys+0)) = CRC32((*(pkeys+0)), c);
    (*(pkeys+1)) += (*(pkeys+0)) & 0xff;
    (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
    {
      register int keyshift = (int)((*(pkeys+1)) >> 24);
      (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
    }
    return c;
}


/***********************************************************************
 * Initialize the encryption keys and the random header according to
 * the given password.
 */
static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t* pcrc_32_tab)
{
    *(pkeys+0) = 305419896L;
    *(pkeys+1) = 591751049L;
    *(pkeys+2) = 878082192L;
    while (*passwd != '\0') {
        update_keys(pkeys,pcrc_32_tab,(int)*passwd);
        passwd++;
    }
}

#define zdecode(pkeys,pcrc_32_tab,c) \
    (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))

#define zencode(pkeys,pcrc_32_tab,c,t) \
    (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))

#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED

#define RAND_HEAD_LEN  12
   /* "last resort" source for second part of crypt seed pattern */
#  ifndef ZCR_SEED2
#    define ZCR_SEED2 3141592654UL     /* use PI as default pattern */
#  endif

static int crypthead(const char* passwd,      /* password string */
                     unsigned char* buf,      /* where to write header */
                     int bufSize,
                     unsigned long* pkeys,
                     const z_crc_t* pcrc_32_tab,
                     unsigned long crcForCrypting)
{
    int n;                       /* index in random header */
    int t;                       /* temporary */
    int c;                       /* random byte */
    unsigned char header[RAND_HEAD_LEN-2]; /* random header */
    static unsigned calls = 0;   /* ensure different random header each time */

    if (bufSize<RAND_HEAD_LEN)
      return 0;

    /* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
     * output of rand() to get less predictability, since rand() is
     * often poorly implemented.
     */
    if (++calls == 1)
    {
        srand((unsigned)(time(NULL) ^ ZCR_SEED2));
    }
    init_keys(passwd, pkeys, pcrc_32_tab);
    for (n = 0; n < RAND_HEAD_LEN-2; n++)
    {
        c = (rand() >> 7) & 0xff;
        header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
    }
    /* Encrypt random header (last two bytes is high word of crc) */
    init_keys(passwd, pkeys, pcrc_32_tab);
    for (n = 0; n < RAND_HEAD_LEN-2; n++)
    {
        buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
    }
    buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
    buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
    return n;
}

#endif

  • 11
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这是一个 Rust 语言的 API 文档,介绍了 Tauri 库版本 1.3.0 中的 `WindowBuilder` 结构体。`WindowBuilder` 结构体是用于创建 Tauri 应用程序窗口的构建器。以下是该文档的翻译: # `WindowBuilder` 用于创建 Tauri 应用程序窗口的构建器。 ## 结构体成员 ### `width` 窗口的宽度。默认值为 `800`。 ### `height` 窗口的高度。默认值为 `600`。 ### `title` 窗口的标题。默认值为 `Tauri Application`。 ### `resizable` 窗口是否可以调整大小。默认为 `true`。 ### `fullscreen` 窗口是否全屏。默认为 `false`。 ### `fullscreenable` 窗口是否可以全屏。默认为 `true`。 ### `decorations` 窗口是否有装饰。默认为 `true`。 ### `transparent` 窗口是否透明。默认为 `false`。 ### `always_on_top` 窗口是否总在最上层。默认为 `false`。 ### `icon` 窗口的图标。默认为 `None`。 ### `min_width` 窗口的最小宽度。默认为 `None`。 ### `min_height` 窗口的最小高度。默认为 `None`。 ### `max_width` 窗口的最大宽度。默认为 `None`。 ### `max_height` 窗口的最大高度。默认为 `None`。 ### `inner_border` 窗口是否有内边框。默认为 `true`。 ### `platform_specific` 在某些平台上启用特定于平台的外观和行为。默认为 `true`。 ## 方法 ### `new() -> WindowBuilder` 创建新的 `WindowBuilder` 实例。 ### `build(&self) -> Result<Window, String>` 使用该构建器创建并返回一个新的 `Window` 实例。如果构建器的参数不正确,则返回一个 `Err`。 ### `with_title<S: Into<String>>(mut self, title: S) -> Self` 设置窗口标题。 ### `with_width(mut self, width: f64) -> Self` 设置窗口的宽度。 ### `with_height(mut self, height: f64) -> Self` 设置窗口的高度。 ### `with_resizable(mut self, resizable: bool) -> Self` 设置窗口是否可以调整大小。 ### `with_fullscreen(mut self, fullscreen: bool) -> Self` 设置窗口是否全屏。 ### `with_fullscreenable(mut self, fullscreenable: bool) -> Self` 设置窗口是否可以全屏。 ### `with_decorations(mut self, decorations: bool) -> Self` 设置窗口是否有装饰。 ### `with_transparent(mut self, transparent: bool) -> Self` 设置窗口是否透明。 ### `with_always_on_top(mut self, always_on_top: bool) -> Self` 设置窗口是否总在最上层。 ### `with_icon(mut self, icon: Icon) -> Self` 设置窗口的图标。 ### `with_min_width(mut self, min_width: f64) -> Self` 设置窗口的最小宽度。 ### `with_min_height(mut self, min_height: f64) -> Self` 设置窗口的最小高度。 ### `with_max_width(mut self, max_width: f64) -> Self` 设置窗口的最大宽度。 ### `with_max_height(mut self, max_height: f64) -> Self` 设置窗口的最大高度。 ### `with_inner_border(mut self, inner_border: bool) -> Self` 设置窗口是否有内边框。 ### `with_platform_specific(mut self, platform_specific: bool) -> Self` 设置是否在某些平台上启用特定于平台的外观和行为。 ## 示例 ```rust use tauri::WindowBuilder; let builder = WindowBuilder::new() .with_title("My App") .with_width(800.0) .with_height(600.0); let window = builder.build().unwrap(); ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值