将/ usr / include / openssl包含到项目中后出错 新手

问题描述

我正在Fedora桌面上使用Eclipse(2020-06)和CDT,并试图学习C ++。

在我的代码中,下面的行编译没有问题:

  rc = read(Socket_ID,&ts,BUFSIZ);
  if (rc == -1) {
    warnx("Reading timestamp Failed");
    Socket_ID = -1;
  }

将/ usr / include / openssl添加到C / C ++构建设置中后,出现此错误

error: ‘warnx’ was not declared in this scope

此刻,我什至还没有包含openssl / md5.h

删除“ warnx”行后,代码将正确编译。

这是否意味着openssl不能在CPP项目中使用,或者Eclipse是否需要其他设置?

解决方法

不是,这并不意味着,但是您无需在包含设置中添加max_workers = URLS//10 with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor: ... ,因为已经在opensp中提到了openssl

/usr/include/openssl

只有你说

#include <openssl/md5.h>

您需要将/ usr / include / openssl添加到您的设置中。

似乎很普遍的误解是,必须在include设置和#include <md5.h> 伪指令中都提及“ library”目录,但事实并非如此。