Hurricane Tong
2014-Feb-13 01:48 UTC
[Xapian-devel] A beginner in "Posting list encoding improvements"
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 ------------------ HurricaneTong,Second Year Undergraduate, School of Computer Science, Fudan University, China. ------------------ Original ------------------ From: "Ralf Mattes";<rm at seid-online.de>; Date: Wed, Feb 12, 2014 11:02 PM To: "James Aylett"<james-xapian at tartarus.org>; Cc: "Hurricane Tong"<zhangshangtong.cpp at qq.com>; "xapian-devel"<xapian-devel at lists.xapian.org>; Subject: Re: [Xapian-devel] A beginner in "Posting list encoding improvements" On Wed, Feb 12, 2014 at 03:07:30PM +0000, James Aylett wrote:> On 12 Feb 2014, at 14:58, "Hurricane Tong" <zhangshangtong.cpp at qq.com> wrote: > > > hurricanetong at hurricanetong-VirtualBox:~/workspace$ g++ `xapian-config --cxxflags --libs` BuildIndexDemo.cpp > > You want to use xapian-config-1.3 here, not xapian-config (which will be the installed version, not the trunk version you built).Oh, dear - unless the OP know _exactly_ what he's doing he should remove the distributions devel package to avoid hard-to-debug problems: sudo apt-get purge libxapian-dev> I've just built trunk (on Mac OS, admittedly), and your code compiled and linked fine, and when run created an empty database as expected.The code post4ed works fine on Debian/testing with the distributed devel packages as well. Cheers, RalfD . -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20140213/1bac5368/attachment-0002.html>
Olly Betts
2014-Feb-13 02:09 UTC
[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 -lxapianThis 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
Hurricane Tong
2014-Feb-13 02:34 UTC
[Xapian-devel] 回复: A beginner in "Posting list encoding improvements"
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 -lxapianThis 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-0002.html>
Maybe Matching Threads
- A beginner in "Posting list encoding improvements"
- A beginner in "Posting list encoding improvements"
- A beginner in "Posting list encoding improvements"
- A beginner in "Posting list encoding improvements"
- Trying to get Search::Xapian perl module to compile on win32