[Xapian-devel] 回复: A beginner in "Posting list encoding improvements"

Hurricane Tong zhangshangtong.cpp at qq.com
Thu Feb 13 02:34:00 GMT 2014


I think what i did is the same with you except i use make rather than make -sj8, and I did as root.
And I do as you wrote again:


root at hurricanetong-VirtualBox:/home/hurricanetong/xapian-1.2.17/xapian-core-1.2.17# ./configure

[...]
root at hurricanetong-VirtualBox:/home/hurricanetong/xapian-1.2.17/xapian-core-1.2.17# make -sj8
Making all in .
Making all in docs
Making all in tests

root at hurricanetong-VirtualBox:/home/hurricanetong/xapian-1.2.17/xapian-core-1.2.17# sudo make install

[...]


then


root at hurricanetong-VirtualBox:/home/hurricanetong/workspace# g++ `xapian-config --cxxflags --libs` demo2.cpp
/tmp/ccRXtBxB.o: In function `main':
demo2.cpp:(.text+0x4a): undefined reference to `Xapian::WritableDatabase::WritableDatabase(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
demo2.cpp:(.text+0x73): undefined reference to `Xapian::WritableDatabase::~WritableDatabase()'
demo2.cpp:(.text+0x98): undefined reference to `Xapian::WritableDatabase::~WritableDatabase()'
collect2: ld 返回 1





root at hurricanetong-VirtualBox:/home/hurricanetong/workspace# which xapian-config
/usr/local/bin/xapian-config
root at hurricanetong-VirtualBox:/home/hurricanetong/workspace# xapian-config --version
xapian-config - xapian-core 1.2.17



root at hurricanetong-VirtualBox:/home/hurricanetong/workspace#  ls -l /usr/local/lib/libxapian*
-rw-r--r-- 1 root root 37827146  2月 13 10:21 /usr/local/lib/libxapian.a
-rwxr-xr-x 1 root root      944  2月 13 10:21 /usr/local/lib/libxapian.la
lrwxrwxrwx 1 root root       19  2月 13 10:21 /usr/local/lib/libxapian.so -> libxapian.so.22.6.4
lrwxrwxrwx 1 root root       19  2月 13 10:21 /usr/local/lib/libxapian.so.22 -> libxapian.so.22.6.4
-rwxr-xr-x 1 root root 19577253  2月 13 10:21 /usr/local/lib/libxapian.so.22.6.4



Best Regards.




------------------
HurricaneTong,Second Year Undergraduate,
School of Computer Science,
Fudan University, China.


 




------------------ 原始邮件 ------------------
发件人: "Olly Betts";<olly at survex.com>;
发送时间: 2014年2月13日(星期四) 上午10:09
收件人: "Hurricane Tong"<zhangshangtong.cpp at qq.com>; 
抄送: "xapian-devel"<xapian-devel at lists.xapian.org>; 
主题: Re: [Xapian-devel] A beginner in "Posting list encoding improvements"



On Thu, Feb 13, 2014 at 09:48:27AM +0800, Hurricane Tong wrote:
> I uninstall xapian1.3 and install xapian-1.2.17
> but i still failed
> 
> hurricanetong at hurricanetong-VirtualBox:~/workspace$ g++ `xapian-config --cxxflags --libs` demo2.cc
> /tmp/cc2wsfDJ.o: In function `main':
> demo2.cc:(.text+0x4a): undefined reference to `Xapian::WritableDatabase::WritableDatabase(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
> demo2.cc:(.text+0x73): undefined reference to `Xapian::WritableDatabase::~WritableDatabase()'
> demo2.cc:(.text+0x98): undefined reference to `Xapian::WritableDatabase::~WritableDatabase()'
> collect2: ld 返回 1
> 
> and
> 
> hurricanetong at hurricanetong-VirtualBox:~/workspace$ xapian-config --cxxflags --libs
> -I/usr/local/include
> -L/usr/local/lib -lxapian

This works for me on Debian unstable with a locally installed xapian-core
1.2.17, which I built using:

$ tar xf xapian-core-1.2.17.tar.xz
$ cd xapian-core-1.2.17
$ ./configure
[...]
$ make -sj8 # quieter build, 8-way parallel
[...]
$ sudo make install
[...]

And then:

$ g++ `xapian-config --cxxflags --libs` BuildIndexDemo.cpp 
$ ./a.out
$ ls -l database
total 16
-rw-r--r-- 1 olly olly  0 Feb 13 15:05 flintlock
-rw-r--r-- 1 olly olly 28 Feb 13 15:05 iamchert
-rw-r--r-- 1 olly olly 13 Feb 13 15:05 postlist.baseA
-rw-r--r-- 1 olly olly  0 Feb 13 15:05 postlist.DB
-rw-r--r-- 1 olly olly 13 Feb 13 15:05 record.baseA
-rw-r--r-- 1 olly olly  0 Feb 13 15:05 record.DB
-rw-r--r-- 1 olly olly 13 Feb 13 15:05 termlist.baseA
-rw-r--r-- 1 olly olly  0 Feb 13 15:05 termlist.DB

I'd check you're running the xapian-config you think you are:

$ which xapian-config
/usr/local/bin/xapian-config
$ xapian-config --version
xapian-config - xapian-core 1.2.17

If you're getting a different xapian-config, you can give an explicit path
to it:

$ g++ `/usr/local/bin/xapian-config --cxxflags --libs` BuildIndexDemo.cpp 

And that the xapian library is really installed in /usr/local/lib:

$ ls -l /usr/local/lib/libxapian*
-rw-r--r-- 1 root staff 78693312 Feb 13 15:02 /usr/local/lib/libxapian.a
-rwxr-xr-x 1 root staff      944 Feb 13 15:02 /usr/local/lib/libxapian.la
lrwxrwxrwx 1 root staff       19 Feb 13 15:02 /usr/local/lib/libxapian.so -> libxapian.so.22.6.4
lrwxrwxrwx 1 root staff       19 Feb 13 15:02 /usr/local/lib/libxapian.so.22 -> libxapian.so.22.6.4
-rwxr-xr-x 1 root staff 28428107 Feb 13 15:02 /usr/local/lib/libxapian.so.22.6.4

Cheers,
    Olly
.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20140213/d893ae99/attachment-0001.html>


More information about the Xapian-devel mailing list