C - 在 Ubuntu v12.10 上编译 OpenSSL 头文件的问题

标签 c ubuntu compiler-errors openssl

我正在尝试在 Ubuntu v12.10 32 位上的 Eclipse CDT (v1.2.0.201212170456) 中编译以下 C 代码。

#include <openssl/bio.h>

int main(void)
{
    return 0;
}

我的编译器是 arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2010q1-202) 4.4.1。我已经设置了 openssl 文件夹的路径,它位于/usr/include 中。当我在 #include 行上按 F3 时,Eclipse CDT 打开 bio.h 文件。当我编译代码时,出现大约 500 个错误,如下所示:

expected ';' before 'int' line 301, external location: /usr/include/openssl/bio.h

int (*bwrite)(BIO *, const char *, int); <-- bio.h 中的第 300 行

int (*bread)(BIO *, char *, int); <-- bio.h 中的第 301 行

expected ';', ',' or ')' before '*' token line 234, external location: /usr/include/openssl/bio.h

void BIO_set_flags(BIO *b, int flags); <-- bio.h 中的第 233 行

int BIO_test_flags(const BIO *b, int flags); <-- bio.h 中的第 234 行

我同时安装了 libssl 和 libssl-dev。我真的不知道可能是什么原因。请帮忙!

来自 CDT 的控制台输出:

arm-none-linux-gnueabi-gcc -I/usr/include -O0 -g3 -Wall -c -fmessage-length=0 -v -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.c"

最佳答案

回答我自己的问题。

我能够按照 SB. 给出的说明解决问题在 this SO thread .

当我静态链接到 OpenSSL 时,我已将以下文件复制到我在 Eclipse CDT 中的 C 项目。

  • libcrypto.a
  • libssl.a

关于C - 在 Ubuntu v12.10 上编译 OpenSSL 头文件的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14892626/

相关文章:

apache - 每个用户的 ProFtpd 主目录

ubuntu - 如何在 Ubuntu 14.04 上安装最新的 Boost 版本?

objective-c - 初始化程序元素不是编译时常量错误

c - sk_buff 函数 skb_network_header() 和 skb_mac_header() 有什么作用?

无法解决此c程序中的内存管理(valgrind)

python - 用户警告 : failed to import the optional _tifffile C extension module

Java泛型编译器错误: What's wrong?

python - 如何忽略 OSError : [Errno 2] in Python, os linux、usbtmc

c - 一个单词搜索C程序作业

c - MS VS 2008 和 C99