记录一下安装fastdfs的坑还有解决方法,同时也想帮助一些一样错误,但是找不到解决办法的人,这是一篇综合帖子,基本上所有的问题都有解决办法,先别急,先让我们看一下报错信息。
》》》》解答部分1直通车
》》》》解答部分2直通车
第一种报错信息
[root@iZ2ze5tsl5bp6q3ouoa46eZ fastdfs-6.04]# ./make.sh
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O1 -DDEBUG_FLAG -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I../common -I/usr/local/include
In file included from /usr/include/fastcommon/fast_mblock.h:26:0,
from /usr/include/fastcommon/connection_pool.h:26,
from ../common/fdfs_global.h:16,
from ../common/fdfs_global.c:21:
/usr/include/fastcommon/fc_memory.h: In function ‘fc_malloc_ex’:
/usr/include/fastcommon/fc_memory.h:39:52: error: expected ‘)’ before ‘PRId64’
logError("file: %s, line: %d, malloc %"PRId64" bytes fail, "
^
/usr/include/fastcommon/fc_memory.h: In function ‘fc_realloc_ex’:
/usr/include/fastcommon/fc_memory.h:56:53: error: expected ‘)’ before ‘PRId64’
logError("file: %s, line: %d, realloc %"PRId64" bytes fail, "
^
/usr/include/fastcommon/fc_memory.h: In function ‘fc_calloc_ex’:
/usr/include/fastcommon/fc_memory.h:92:52: error: expected ‘)’ before ‘PRId64’
logError("file: %s, line: %d, malloc %"PRId64" bytes fail, "
^
In file included from /usr/include/fastcommon/connection_pool.h:26:0,
from ../common/fdfs_global.h:16,
from ../common/fdfs_global.c:21:
/usr/include/fastcommon/fast_mblock.h: At top level:
/usr/include/fastcommon/fast_mblock.h:110:5: error: unknown type name ‘pthread_lock_cond_pair_t’
pthread_lock_cond_pair_t lcp; //for read / write free node chain
^
/usr/include/fastcommon/fast_mblock.h: In function ‘fast_mblock_set_need_wait’:
/usr/include/fastcommon/fast_mblock.h:214:64: error: expected ‘)’ before ‘PRId64’
"need_lock: %d != 1 or alloc_elements.limit: %"PRId64" <= 0",
^
/usr/include/fastcommon/fast_mblock.h:223:51: error: ‘LOG_NOTHING’ undeclared (first use in this function)
mblock->alloc_elements.exceed_log_level = LOG_NOTHING;
^
/usr/include/fastcommon/fast_mblock.h:223:51: note: each undeclared identifier is reported only once for each function it appears in
In file included from /usr/include/fastcommon/ini_file_reader.h:24:0,
from /usr/include/fastcommon/connection_pool.h:27,
from ../common/fdfs_global.h:16,
from ../common/fdfs_global.c:21:
/usr/include/fastcommon/hash.h: At top level:
/usr/include/fastcommon/hash.h:215:1: error: unknown type name ‘string_t’
static inline void *hash_find1(HashArray *pHash, const string_t *key)
^
/usr/include/fastcommon/hash.h: In function ‘hash_find1’:
/usr/include/fastcommon/hash.h:217:32: error: request for member ‘str’ in something not a structure or union
return hash_find(pHash, key->str, key->len);
^
/usr/include/fastcommon/hash.h:217:42: error: request for member ‘len’ in something not a structure or union
return hash_find(pHash, key->str, key->len);
^
/usr/include/fastcommon/hash.h: At top level:
/usr/include/fastcommon/hash.h:228:1: error: unknown type name ‘string_t’
int hash_find2(HashArray *pHash, const string_t *key, string_t *value);
^
/usr/include/fastcommon/hash.h:228:55: error: unknown type name ‘string_t’
int hash_find2(HashArray *pHash, const string_t *key, string_t *value);
^
/usr/include/fastcommon/hash.h:237:1: error: unknown type name ‘string_t’
HashData *hash_find1_ex(HashArray *pHash, const string_t *key);
^
In file included from /usr/include/fastcommon/pthread_func.h:26:0,
from /usr/include/fastcommon/connection_pool.h:28,
from ../common/fdfs_global.h:16,
from ../common/fdfs_global.c:21:
/usr/include/fastcommon/shared_func.h:299:19: error: unknown type name ‘string_t’
void string_ltrim(string_t *s);
^
/usr/include/fastcommon/shared_func.h:306:19: error: unknown type name ‘string_t’
void string_rtrim(string_t *s);
^
/usr/include/fastcommon/shared_func.h:314:32: error: unknown type name ‘string_t’
static inline void string_trim(string_t *s)
^
/usr/include/fastcommon/shared_func.h:431:1: error: unknown type name ‘string_t’
int split_string_ex(const string_t *src, const char seperator,
^
/usr/include/fastcommon/shared_func.h:432:9: error: unknown type name ‘string_t’
string_t *dest, const int max_count, const bool ignore_empty);
^
/usr/include/fastcommon/shared_func.h:900:1: error: unknown type name ‘string_t’
const char *fc_memmem(const string_t *str, const string_t *needle);
^
/usr/include/fastcommon/shared_func.h:900:1: error: unknown type name ‘string_t’
/usr/include/fastcommon/shared_func.h:1003:30: error: unknown type name ‘string_t’
const int buff_size, string_t *line);
^
/usr/include/fastcommon/shared_func.h:1006:50: error: unknown type name ‘string_t’
const int buff_size, int64_t *file_size, string_t *line);
^
/usr/include/fastcommon/shared_func.h:1009:30: error: unknown type name ‘string_t’
const int buff_size, string_t *lines, int *count);
^
/usr/include/fastcommon/shared_func.h:1018:1: error: unknown type name ‘string_t’
bool fc_path_contains(const string_t *path, const string_t *needle,
^
/usr/include/fastcommon/shared_func.h:1018:1: error: unknown type name ‘string_t’
In file included from /usr/include/fastcommon/sched_thread.h:25:0,
from /usr/include/fastcommon/pthread_func.h:27,
from /usr/include/fastcommon/connection_pool.h:28,
from ../common/fdfs_global.h:16,
from ../common/fdfs_global.c:21:
/usr/include/fastcommon/fc_queue.h:37:5: error: unknown type name ‘pthread_lock_cond_pair_t’
pthread_lock_cond_pair_t lc_pair;
^
/usr/include/fastcommon/fc_queue.h: In function ‘fc_queue_terminate’:
/usr/include/fastcommon/fc_queue.h:51:40: error: request for member ‘cond’ in something not a structure or union
pthread_cond_signal(&queue->lc_pair.cond);
^
/usr/include/fastcommon/fc_queue.h: In function ‘fc_queue_terminate_all’:
/usr/include/fastcommon/fc_queue.h:59:45: error: request for member ‘cond’ in something not a structure or union
pthread_cond_signal(&(queue->lc_pair.cond));
^
/usr/include/fastcommon/fc_queue.h: In function ‘fc_queue_push’:
/usr/include/fastcommon/fc_queue.h:72:45: error: request for member ‘cond’ in something not a structure or union
pthread_cond_signal(&(queue->lc_pair.cond));
^
/usr/include/fastcommon/fc_queue.h: In function ‘fc_queue_push_queue_to_head’:
/usr/include/fastcommon/fc_queue.h:92:45: error: request for member ‘cond’ in something not a structure or union
pthread_cond_signal(&(queue->lc_pair.cond));
^
/usr/include/fastcommon/fc_queue.h: In function ‘fc_queue_empty’:
/usr/include/fastcommon/fc_queue.h:111:39: error: request for member ‘lock’ in something not a structure or union
pthread_mutex_lock(&queue->lc_pair.lock);
^
/usr/include/fastcommon/fc_queue.h:113:41: error: request for member ‘lock’ in something not a structure or union
pthread_mutex_unlock(&queue->lc_pair.lock);
^
In file included from /usr/include/fastcommon/connection_pool.h:28:0,
from ../common/fdfs_global.h:16,
from ../common/fdfs_global.c:21:
/usr/include/fastcommon/pthread_func.h: At top level:
/usr/include/fastcommon/pthread_func.h:37:33: error: unknown type name ‘pthread_lock_cond_pair_t’
int init_pthread_lock_cond_pair(pthread_lock_cond_pair_t *lcp);
^
/usr/include/fastcommon/pthread_func.h:38:37: error: unknown type name ‘pthread_lock_cond_pair_t’
void destroy_pthread_lock_cond_pair(pthread_lock_cond_pair_t *lcp);
^
/usr/include/fastcommon/pthread_func.h: In function ‘fc_timeout_to_timespec’:
/usr/include/fastcommon/pthread_func.h:104:14: error: ‘FC_TIME_UNIT_SECOND’ undeclared (first use in this function)
case FC_TIME_UNIT_SECOND:
^
/usr/include/fastcommon/pthread_func.h:108:14: error: ‘FC_TIME_UNIT_MSECOND’ undeclared (first use in this function)
case FC_TIME_UNIT_MSECOND:
^
/usr/include/fastcommon/pthread_func.h:112:14: error: ‘FC_TIME_UNIT_USECOND’ undeclared (first use in this function)
case FC_TIME_UNIT_USECOND:
^
/usr/include/fastcommon/pthread_func.h:116:14: error: ‘FC_TIME_UNIT_NSECOND’ undeclared (first use in this function)
case FC_TIME_UNIT_NSECOND:
^
/usr/include/fastcommon/pthread_func.h: At top level:
/usr/include/fastcommon/pthread_func.h:130:37: error: unknown type name ‘pthread_lock_cond_pair_t’
static inline int fc_cond_timedwait(pthread_lock_cond_pair_t *lcp,
^
../common/fdfs_global.c:23:30: error: ‘DEFAULT_CONNECT_TIMEOUT’ undeclared here (not in a function)
int g_fdfs_connect_timeout = DEFAULT_CONNECT_TIMEOUT;
^
make: *** [../common/fdfs_global.o] Error 1
cc -Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -g -O1 -DDEBUG_FLAG -c -o ../common/fdfs_global.o ../common/fdfs_global.c -I. -Itrunk_mgr -I../common -I../tracker -I../client -Ifdht_client -I/usr/include/fastcommon
In file included from /usr/include/fastcommon/fast_mblock.h:26:0,
from /usr/include/fastcommon/connection_pool.h:26,
from ../common/fdfs_global.h:16,
from ../common/fdfs_global.c:21:
/usr/include/fastcommon/fc_memory.h: In function ‘fc_malloc_ex’:
/usr/include/fastcommon/fc_memory.h:39:52: error: expected ‘)’ before ‘PRId64’
logError("file: %s, line: %d, malloc %"PRId64" bytes fail, "
^
/usr/include/fastcommon/fc_memory.h: In function ‘fc_realloc_ex’:
/usr/include/fastcommon/fc_memory.h:56:53: error: expected ‘)’ before ‘PRId64’
logError("file: %s, line: %d, realloc %"PRId64" bytes fail, "
^
/usr/include/fastcommon/fc_memory.h: In function ‘fc_calloc_ex’:
/usr/include/fastcommon/fc_memory.h:92:52: error: expected ‘)’ before ‘PRId64’
logError("file: %s, line: %d, malloc %"PRId64" bytes fail, "
^
In file included from /usr/include/fastcommon/connection_pool.h:26:0,
from ../common/fdfs_global.h:16,
from ../common/fdfs_global.c:21:
/usr/include/fastcommon/fast_mblock.h: At top level:
/usr/include/fastcommon/fast_mblock.h:110:5: error: unknown type name ‘pthread_lock_cond_pair_t’
pthread_lock_cond_pair_t lcp; //for read / write free node chain
^
/usr/include/fastcommon/fast_mblock.h: In function ‘fast_mblock_set_need_wait’:
/usr/include/fastcommon/fast_mblock.h:214:64: error: expected ‘)’ before ‘PRId64’
"need_lock: %d != 1 or alloc_elements.limit: %"PRId64" <= 0",
^
/usr/include/fastcommon/fast_mblock.h:223:51: error: ‘LOG_NOTHING’ undeclared (first use in this function)
mblock->alloc_elements.exceed_log_level = LOG_NOTHING;
^
/usr/include/fastcommon/fast_mblock.h:223:51: note: each undeclared identifier is reported only once for each function it appears in
In file included from /usr/include/fastcommon/ini_file_reader.h:24:0,
from /usr/include/fastcommon/connection_pool.h:27,
from ../common/fdfs_global.h:16,
from ../common/fdfs_g