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>
Olly Betts
2014-Feb-13 05:32 UTC
[Xapian-devel] 回复: A beginner in "Posting list encoding improvements"
On Thu, Feb 13, 2014 at 10:34:00AM +0800, Hurricane Tong wrote:> I think what i did is the same with you except i use make rather than > make -sj8, and I did as root.It's better to create yourself a user for development work and do as little as possible as root. The root user has the rights to do almost anything, so you can accidentally do a lot of damage (e.g. "rm *" in the wrong directory) and a malicious program can do a lot more damage too. But compiling as root shouldn't make a difference here.> 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 ?? 1I don't know why this isn't working, as it does for me and others. Passing the libs last might be worth trying: g++ `xapian-config --cxxflags` demo2.cpp `xapian-config --libs` You can also compile with -v to see more details of the process: g++ -v `xapian-config --cxxflags --libs` demo2.cpp What version of Ubuntu have you installed? Cheers, Olly
Hurricane Tong
2014-Feb-13 06:02 UTC
[Xapian-devel] 回复: 回复: A beginnerin "Posting list encoding improvements"
It's amazing, "g++ `xapian-config --cxxflags` demo2.cpp `xapian-config --libs` " work in ubuntu. ------------------ HurricaneTong,Second Year Undergraduate, School of Computer Science, Fudan University, China. ------------------ ???? ------------------ ???: "Olly Betts";<olly at survex.com>; ????: 2014?2?13?(???) ??1:32 ???: "Hurricane Tong"<zhangshangtong.cpp at qq.com>; ??: "Xapian Development"<xapian-devel at lists.xapian.org>; ??: Re: [Xapian-devel] ??? A beginnerin "Posting list encoding improvements" On Thu, Feb 13, 2014 at 10:34:00AM +0800, Hurricane Tong wrote:> I think what i did is the same with you except i use make rather than > make -sj8, and I did as root.It's better to create yourself a user for development work and do as little as possible as root. The root user has the rights to do almost anything, so you can accidentally do a lot of damage (e.g. "rm *" in the wrong directory) and a malicious program can do a lot more damage too. But compiling as root shouldn't make a difference here.> 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 ?? 1I don't know why this isn't working, as it does for me and others. Passing the libs last might be worth trying: g++ `xapian-config --cxxflags` demo2.cpp `xapian-config --libs` You can also compile with -v to see more details of the process: g++ -v `xapian-config --cxxflags --libs` demo2.cpp What version of Ubuntu have you installed? Cheers, Olly . -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20140213/338a848b/attachment-0002.html>