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

Hurricane Tong zhangshangtong.cpp at qq.com
Thu Feb 13 06:02:17 GMT 2014


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 返回 1

I 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.html>


More information about the Xapian-devel mailing list