头文件麻烦 [英] Trouble with header file

查看:212
本文介绍了头文件麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编译我编写的c代码时,我收到以下错误。我明白问题出在头文件中。任何人都可以告诉我需要哪些头文件来定义这些功能。

I got the following error on compiling a c code I wrote. I understand that the problem is in the header file. Can anyone please tell me which all header files are needed to define these functions.

sign.c: In function ‘main’:
sign.c:78: warning: assignment makes pointer from integer without a cast
/tmp/ccnsSeHy.o: In function `sign_data_evp':
sign.c:(.text+0x68): undefined reference to `check_ssl_rv'
sign.c:(.text+0xd5): undefined reference to `check_ssl_rv'
sign.c:(.text+0x13e): undefined reference to `check_ssl_rv'
/tmp/ccnsSeHy.o: In function `main':
sign.c:(.text+0x1ca): undefined reference to `initialize'
sign.c:(.text+0x1d6): undefined reference to `select_engine'
sign.c:(.text+0x20a): undefined reference to `sign_data'
sign.c:(.text+0x216): undefined reference to `clean_engine'
sign.c:(.text+0x21b): undefined reference to `clean_up'
collect2: ld returned 1 exit status

目前我使用的头文件是:

The header files that I have used so far is:

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <netdb.h>
#include <unistd.h>
#ifdef __VMS
#include <socket.h>
#include <inet.h>

#include <in.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif

#include <openssl/crypto.h>
#include <openssl/ssl.h>
#include <openssl/err.h>

操作平台:Linux
提前感谢

Operating platform: Linux Thanks in advance.

推荐答案

你明白错了。它不抱怨未知功能原型,它在链接期间抱怨。所以你可能忘了链接某些库或一些对象文件。

You understand it wrong. It does not complain about unknown function prototype, it complains during the linking. So you probably forgot to link with some library or some object file.

这篇关于头文件麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆