2016-06-15 4 views
3

SOCATをインストールしようとしていますが、私はC++で非常に軽いです。だから私はダウンロード1.7.3.1の最新の安定版を入手することができる午前HERE指示に従って、私は./configureを介して取得するが、私は./makeに入るとき、私は次のエラーを取得:SOCATをRedhatでコンパイルする

nestlex.c:14:7: error: unknown type name ‘ptrdiff_t’ 
     ptrdiff_t *len, 
    ^
nestlex.c: In function ‘nestlex’: 
nestlex.c:48:7: warning: implicit declaration of function ‘_nestlex’ [-Wimplicit-function-declaration] 
     _nestlex(addr, token, (ptrdiff_t *)len, ends, hquotes, squotes, nests, 
    ^
nestlex.c:48:30: error: ‘ptrdiff_t’ undeclared (first use in this function) 
     _nestlex(addr, token, (ptrdiff_t *)len, ends, hquotes, squotes, nests, 
          ^
nestlex.c:48:30: note: each undeclared identifier is reported only once for each function it appears in 
nestlex.c:48:41: error: expected expression before ‘)’ token 
     _nestlex(addr, token, (ptrdiff_t *)len, ends, hquotes, squotes, nests, 
             ^
nestlex.c: At top level: 
nestlex.c:54:7: error: unknown type name ‘ptrdiff_t’ 
     ptrdiff_t *len, 
    ^
nestlex.c: In function ‘nestlex’: 
nestlex.c:50:1: warning: control reaches end of non-void function [-Wreturn-type] 
} 
^ 
make: *** [nestlex.o] Error 1 

システム情報を:

cat system-release 
Red Hat Enterprise Linux Server release 7.2 (Maipo) 

rpm -qa |grep gcc 
libgcc-4.8.5-4.el7.x86_64 
gcc-4.8.5-4.el7.x86_64 

rpm -qa |grep glibc 
glibc-common-2.17-106.el7_2.6.x86_64 
glibc-2.17-106.el7_2.6.x86_64 
glibc-devel-2.17-106.el7_2.6.x86_64 
glibc-headers-2.17-106.el7_2.6.x86_64 

rpm -qa |grep gd 
gdisk-0.8.6-5.el7.x86_64 
gd-2.0.35-26.el7.x86_64 
gdbm-1.10-8.el7.x86_64 

私はソースからインストールしなければならないことにかなり慣れているので、ここからどこに行くのか分かりません。私はいくつかの記事で正しいバージョンのヘッダーがインストールされていないと問題を説明していることを発見しました。誰かが私を正しい方向に向けることができたら、私はそれを高く評価します。

ありがとうございます。

+0

詳細:レポートにのみ致命的なものは、 'ptrdiff_t'(エラー)残りはノイズをフォローアップしているように見えるが知られていません。したがって、設定ステップでは、必要なインクルードヘッダファイルの間違った検出や、ソースソース自体の間違いがありました。 – Dilettant

+1

nestlex.cを開いて、そのタイプが定義されている '#include 'がそこにあるかどうかを調べます。 – renemilk

+0

nestkex、cがあります の#include "config.hの" の#include "mytypes.h" の#include "sysincludes.h" – John

答えて

4

不明なタイプは、ヘッダファイルstddef.hで定義されています。エラーが報告されたコンパイルのファイルに#include <stddef.h>がない場合は、上部のどこかに追加してください。ヘッダーインクルードは本質的に推移的なので、インクルードされている別のヘッダーに必要なインクルードが含まれていて、何らかの理由でインクルードされた新しいバージョンが削除されたときに、この種のエラーが発生することがあります。

一般的には、hereなどを検索することで一般的なタイプが定義されている場所を見つけることができます。

0

は実際にsocatに関するsocat.specデフォルト設定が使用されているエラーなしで構築します。socatに関する-1.7.3.1 -1.fc25.src.rpm→→

./configure \ 
     --enable-help --enable-stdio \ 
     --enable-fdnum --enable-file --enable-creat \ 
     --enable-gopen --enable-pipe --enable-termios \ 
     --enable-unix --enable-ip4 --enable-ip6 \ 
     --enable-rawip --enable-tcp --enable-udp \ 
     --enable-listen --enable-proxy --enable-exec \ 
     --enable-system --enable-pty --enable-readline \ 
     --enable-openssl --enable-sycls --enable-filan \ 
     --enable-retry --enable-libwrap --enable-fips 

を見てください。 socat-1.7.3.1-1.fc25.src.rpm (http://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/source/tree/Packages/s/socat-1.7.3.1-1.fc25.src.rpm)から、$ rpmbuild -bb socat.specのsocat-1.7.3.1-1.el7.x86_64.rpmを作成することもできます。


関連する問題