小编Xwi*_*arg的帖子

尝试使用 conan 安装 gtest 时出现 HTTPSConnectionPool 错误

我正在尝试使用 conan 来安装 gtest,但是当我这样做时出现以下错误:

gtest/1.11.0: Not found in local cache, looking in remotes...
gtest/1.11.0: Trying with 'conancenter'...
ERROR: HTTPSConnectionPool(host='center.conan.io', port=443): Max retries exceeded with url: /v1/ping (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))

Unable to connect to conancenter=https://center.conan.io
1. Make sure the remote is reachable or,
2. Disable it by using conan remote disable,
Then try again.
Run Code Online (Sandbox Code Playgroud)

但是我不确定为什么它不起作用
该包确实存在(https://conan.io/center/gtest
而且我还使用 conan 来安装其他包,我对它们没有任何问题

我的完整 conan 文件如下所示:

[requires]
libcurl/7.78.0
cjson/1.7.15
gtest/1.11.0

[options]
openssl:shared=True

[generators]
cmake
Run Code Online (Sandbox Code Playgroud)

有人知道我为什么会出现这个错误吗?
我使用的是 Windows …

c++ cmake googletest conan

5
推荐指数
1
解决办法
2942
查看次数

Clang 中的结构填充警告

我创建了以下结构:

typedef struct  s_fct_printf
{
  char          flag;
  void          (*fct)(void*);
}               t_fct_printf;

static const t_fct_printf       flags[] =
{
  { 's', my_putstr_printf },
  //[...]
  { 'b', display_base_2 },
};
Run Code Online (Sandbox Code Playgroud)

但是当我使用 clang option 编译时-Weverything,出现以下警告:

typedef struct  s_fct_printf
{
  char          flag;
  void          (*fct)(void*);
}               t_fct_printf;

static const t_fct_printf       flags[] =
{
  { 's', my_putstr_printf },
  //[...]
  { 'b', display_base_2 },
};
Run Code Online (Sandbox Code Playgroud)

我找到了以下解决方案:

typedef struct  s_fct_printf
{
  char          flag;
  void          (*fct)(void*);
  char          pad[7];
}               t_fct_printf;
Run Code Online (Sandbox Code Playgroud)

但这并不能解决问题:

warning: padding struct 'struct s_fct_printf' with 7 …
Run Code Online (Sandbox Code Playgroud)

c padding

2
推荐指数
1
解决办法
7792
查看次数

在 Javascript 中导入 Typescript 文件

我正在制作一个 Chrome 扩展程序,并尝试在 Javascript 中导入 Typescript 文件。两个文件彼此相邻。

我这样导入:

import { ApiParsing } from './ApiParsing.ts';
Run Code Online (Sandbox Code Playgroud)

当我使用扩展程序时,出现以下错误:

Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
Run Code Online (Sandbox Code Playgroud)

javascript google-chrome-extension typescript

2
推荐指数
1
解决办法
2万
查看次数

具有内部 set 和 protected get 的属性

我想这样做一个变量(我们称之为 Foo),它只能在程序集中修改,但可以被任何子类访问,甚至在程序集之外所以我想要一个内部集和一个受保护的 get:

这样做protected int Foo { internal set; get; }告诉我这个集合必须比属性或索引器更具限制性但是internal int Foo { set; protected get; }告诉我同样的事情对于 get

我该如何解决?

c#

2
推荐指数
1
解决办法
116
查看次数