Tor를 약간 수정 한 후 컴파일하는 데 문제가 있습니다.헤더 포함 문제
control.c
파일에는 rend_service_t
(rendservice.h
에 위치) 구조체를 나타내는 코드가 추가되었습니다. 나는 그것을 이전에 포함하지 않았기 때문에 control.c
의 상단에 rendservice.h
을 포함 시켰습니다. 나는 메이크 파일이 포함 된 사용하려고하면
,이 오류가 얻을 :
control.c:2841: error: 'rend_service_t' undeclared (first use in this function)
내가 rendservice.c
포함지고 있지 않거나 처음 컴파일 점점되지 같은데요를, 그래서 거기에 디렉토리를 확인 렌더 서비스를위한 오브젝트 파일이 아닙니다. 나는 분명히 포함되어 있기 때문에 약간 혼란 스럽다. 이 문제의 원인은 무엇입니까?
또한 을 편집하여 rendservice.c/h
이 control.c/h
앞에 오도록했으나 아무런 차이가 없습니다. control.c
에서
:
...
#include "rendservice.h"
...
static int
handle_control_addservice(control_connection_t *conn, uint32_t len,
const char *body)
{
smartlist_t *args;
rend_service_t *service;
...
rendservice.c
에서 :
...
/** Represents a single hidden service running at this OP. */
typedef struct rend_service_t {
/* Fields specified in config file */
char *directory; /**< where in the filesystem it stores it */
smartlist_t *ports; /**< List of rend_service_port_config_t */
rend_auth_type_t auth_type; /**< Client authorization type or 0 if no client
* authorization is performed. */
smartlist_t *clients; /**< List of rend_authorized_client_t's of
* clients that may access our service. Can be NULL
* if no client authorization is performed. */
/* Other fields */
crypto_pk_env_t *private_key; /**< Permanent hidden-service key. */
char service_id[REND_SERVICE_ID_LEN_BASE32+1]; /**< Onion address without
* '.onion' */
char pk_digest[DIGEST_LEN]; /**< Hash of permanent hidden-service key. */
smartlist_t *intro_nodes; /**< List of rend_intro_point_t's we have,
* or are trying to establish. */
time_t intro_period_started; /**< Start of the current period to build
* introduction points. */
int n_intro_circuits_launched; /**< Count of intro circuits we have
* established in this period. */
rend_service_descriptor_t *desc; /**< Current hidden service descriptor. */
time_t desc_is_dirty; /**< Time at which changes to the hidden service
* descriptor content occurred, or 0 if it's
* up-to-date. */
time_t next_upload_time; /**< Scheduled next hidden service descriptor
* upload time. */
/** Map from digests of Diffie-Hellman values INTRODUCE2 to time_t of when
* they were received; used to prevent replays. */
digestmap_t *accepted_intros;
/** Time at which we last removed expired values from accepted_intros. */
time_t last_cleaned_accepted_intros;
} rend_service_t;
...
코드를 게시하십시오. –
'rend_service_t '가 어떻게 선언되는지 코드를 보여줄 수 있습니까? 그리고'rend_service_t'를 사용하는 코드는 무엇입니까? – Marlon