简体   繁体   English

在Ubuntu机器上构建htdig

[英]Build htdig on ubuntu machine

On my Ubuntu machine, htdig (www.htdig.org) is installed. 在我的Ubuntu计算机上,安装了htdig(www.htdig.org)。 eg "which htdig" gives me, /usr/bin/htdig 例如“哪个htdig”给我,/ usr / bin / htdig

I want to install htdig under /var/www/my_web_site ie /var/www/my_web_site/htdig 我想在/ var / www / my_web_site下安装htdig,即/ var / www / my_web_site / htdig

Extra info: 额外信息:

  • gcc version 4.9.1 (Ubuntu 4.9.1-16ubuntu6) gcc版本4.9.1(Ubuntu 4.9.1-16ubuntu6)
  • GNU Make 4.0 GNU Make 4.0

For htdig-3.1.6: 对于htdig-3.1.6:

When I run "./configure", I got: 当我运行“ ./configure”时,我得到:

configure: error: To compile ht://Dig, you will need a C++ library. 配置:错误:要编译ht:// Dig,您将需要一个C ++库。 Try installing libstdc++ 尝试安装libstdc ++

"Run /sbin/ldconfig -p | grep stdc++" “运行/ sbin / ldconfig -p | grep stdc ++”

I have: 我有:

  • libstdc++.so.6 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc ++。so.6(libc6,x86-64)=> /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  • libstdc++.so.6 (libc6) => /usr/lib/i386-linux-gnu/libstdc++.so.6 libstdc ++。so.6(libc6)=> /usr/lib/i386-linux-gnu/libstdc++.so.6

I also tried out htdig-3.2.0b6 : 我也尝试了htdig-3.2.0b6

I run "./configure", and it seems fine. 我运行“ ./configure”,看起来很好。 I got something like "Now you must run 'make' followed by 'make install'" 我收到类似“现在必须运行'make',然后运行'make install'”的信息

When I run "make", I got quite a few errors like: 当我运行“ make”时,出现了很多错误,例如:

.....
Making all in htsearch
make[1]: Entering directory '/var/www/test/testme/sounddesign/htdig-3.2.0b6/htsearch'
g++ -DHAVE_CONFIG_H -I. -I. -I../include -DDEFAULT_CONFIG_FILE=\"/opt/www/conf/htdig.conf\" -I../include -I../htlib -I../htnet -I../htcommon -I../htword -I../db -I../db -DCONFIG_DIR=\"/opt/www/conf\" -I../htfuzzy     -g -O2 -Wall -fno-rtti -fno-exceptions -c -o Display.o `test -f 'Display.cc' || echo './'`Display.cc
In file included from Display.cc:30:0:
Collection.h:39:10: error: extra qualification ‘Collection::’ on member ‘Open’ [-fpermissive]
     void Collection::Open();
....
....
....
Display.cc:830:32: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
     if (input->exists("endyear"))
                                ^

Any idea what I should do? 知道我该怎么办吗?

The compiler is complaining that the class prefix Collection:: in Collection.h is both unnecessary, and now, illegal. 编译器抱怨Collection::中的类前缀Collection::既不必要,而且现在是非法的。

Simply change the htsearch/Collection.h header to this: 只需将htsearch / Collection.h标头更改为此:

class Collection : public Object
{
public:
    //
    // Construction/Destruction
    //
    Collection(const char *name, const char *wordFile,
               const char *indexFile, const char *docFile,
               const char *docExcerpt);
    ~Collection();

    // COMMENT OUT OR REMOVE THESE TWO LINES:
    //    void Collection::Open();
    //    void Collection::Close();
    // ADD THESE TWO:
    void Open();
    void Close();

(comment out/remove old lines declaring Open/Close and add the last two lines above) (注释/删除旧行,声明“打开/关闭”,并在上面添加最后两行)

After doing this, htdig 3.2 b 6 compiled successfully for me. 完成此操作后,htdig 3.2 b 6为我成功编译。 The warnings are just that: warnings. 警告仅仅是:警告。 They won't prevent successful compilation. 它们不会阻止成功的编译。 This is now a very old codebase, and some of the C++ is invariably not compliant with current compiler standards. 现在这是一个非常古老的代码库,并且某些C ++始终不符合当前的编译器标准。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM