2012-01-17 32 views
2

私はスーパーセンスタガーと呼ばれるソフトウェアを使用していますが、私は下に貼り付けられたメイクファイルを持っています。実行にコンパイル時にエラー:: :: strcmpが宣言されていません

#Makefile for sst-light 

    CXX = g++ 
    CFLAGS = -g -O1 -DPIC -fPIC -ILIB -I. 

    CXXFLAGS = $(CFLAGS) -fno-exceptions 
    #CXXFLAGS = -g 
    #LIB = -lm ${TAO_LIB} ${PETSC_SNES_LIB} 
    #include ${TAO_DIR}/bmake/tao_common 

    SOURCES = sst-light.cc \ 
LIB/utils/utils.cc \ 
LIB/stats/stats.cc \ 
LIB/results/results.cc \ 
LIB/evaluate/evaluate.cc \ 
LIB/Chain/Chain.cc \ 
LIB/Perceptron/Perceptron.cc \ 
LIB/tagger_light/Tlight.cc \ 
LIB/examples/examples.cc \ 
LIB/features/features.cc 

    MLIBOBJECTS = LIB/utils/utils.o \ 
    LIB/stats/stats.o \ 
    LIB/results/results.o \ 
    LIB/evaluate/evaluate.o \ 
    LIB/Chain/Chain.o \ 
    LIB/Perceptron/Perceptron.o \ 
    LIB/tagger_light/Tlight.o \ 
    LIB/examples/examples.o \ 
LIB/features/features.o 


    OBJECTS = sst-light.o \ 
LIB/utils/utils.o \ 
LIB/stats/stats.o \ 
LIB/results/results.o \ 
LIB/evaluate/evaluate.o \ 
LIB/Chain/Chain.o \ 
LIB/Perceptron/Perceptron.o \ 
LIB/tagger_light/Tlight.o \ 
LIB/examples/examples.o \ 
LIB/features/features.o #\ 
    # /usr/local/WordNet-2.1/lib/libWN.a 

    PEROBJ = Perceptron/Perceptron.o Perceptron/Kernel_Perceptron.o 
    CRFOBJ = CRF/CRF.o 

    SuperSenseTagger: $(OBJECTS) 
     g++ $(OBJECTS) -o sst 

    videotagger: $(MLIBOBJECTS) videotagger.o 
     g++ $(MLIBOBJECTS) videotagger.o -o videotagger 

    to-conll: to-conll.o 
     g++ to-conll.o -o to-conll 

    libwnss.so:  $(MLIBOBJECTS) 
g++ -shared -o libwnss.so $(MLIBOBJECTS) -lm -lpthread -lc -lstdc++ -lgcc_s 

    .PHONY: clean 

    clean: 
     find . -name '*.[od]' -print -exec rm {} \; 
    clean_bak: 
     find . -name '*~' -print -exec rm {} \; 

    # this command tells GNU make to look for dependencies in *.d files 
    -include $(patsubst %.c,%.d,$(SOURCES:%.cc=%.d)) 

私は、次を得る:

g++ -g -O1 -DPIC -fPIC -ILIB -I. -fno-exceptions -c -o sst-light.o sst-light.cpp 
In file included from /usr/include/c++/4.3/ext/hash_map:64, 
       from LIB/examples/../tagger_light/../results/../utils/../hash_stuff/hash_stuff.h:26, 
       from LIB/examples/../tagger_light/../results/../utils/utils.h:31, 
       from LIB/examples/../tagger_light/../results/results.h:29, 
       from LIB/examples/../tagger_light/Tlight.h:29, 
       from LIB/examples/examples.h:19, 
       from sst-light.cpp:21: 
/usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning This file includes at least 
one deprecated or antiquated header which may be removed without further notice at a future date. 
Please use a non-deprecated interface with equivalent functionality instead. For a listing of 
replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. 
In file included from LIB/examples/../tagger_light/../results/../utils/utils.h:31, 
       from LIB/examples/../tagger_light/../results/results.h:29, 
       from LIB/examples/../tagger_light/Tlight.h:29, 
       from LIB/examples/examples.h:19, 
       from sst-light.cpp:21: 
LIB/examples/../tagger_light/../results/../utils/../hash_stuff/hash_stuff.h: In member function 
    âbool std::equal_to<const char*>::operator()(const char*, const char*) constâ: 
LIB/examples/../tagger_light/../results/../utils/../hash_stuff/hash_stuff.h:44: error: â::strcmpâ has not been declared 
make: *** [sst-light.o] Error 1 

誰もがこれを引き起こす可能性のあるものを任意のアイデアを得ましたか。

+0

'Makefile'で' g ++ 'の' -Wall'フラグを忘れました(これは改善すべきです)。 –

答えて

6

はい - gccはコンパイラを更新しました。以前のバージョンで使用していたヘッダーファイルの一部を「デフォルトに含めません」 - 使用しているコードはこれを反映するように更新されていません。

あなたはSST-light.cpp

#include <cstring> 

にstrcmpのために含める追加する必要があるようなコードはC++の古いスタイルを使用しているとしても、それが見えるルックスは、 - そう

#include <iostream.h> 
のようなものを変更します

#include <iostream> 

しかし、唯一のC++ヘッダファイルのためにこれを行います。

1

オープン/sst-light-0.4/LIB/hash_stuff/hash_stuff.hと、これを追加します。

#include <cstring> 

私もMakefileの(それが助けかどうかわからない)にフラグ-Wallを追加しました:sstを実行するには

CFLAGS = -Wall -g -O1 -DPIC -fPIC -ILIB -I. 

./sst 
関連する問題