Closed GoogleCodeExporter closed 9 years ago
I see the same issues on Ubuntu Precise 64bit.
Adding -pthread to LDFLAGS seems to fix `make test` (all tests are passing),
but not `make testinstall`.
Original comment by kmik...@gmail.com
on 12 Feb 2014 at 11:14
I have same issue with `make testinstall`
kevin@ubuntu:~/re2$ make testinstall
cp testinstall.cc obj
(cd obj && g++ -I/usr/local/include -L/usr/local/lib testinstall.cc -lre2
-pthread -o testinstall)
/tmp/cccTNGss.o: In function main':
testinstall.cc:(.text+0xce): undefined reference
tore2::FilteredRE2::FirstMatch(re2::StringPiece const&, std::vector > const&)
const'
/usr/local/lib/libre2.so: undefined reference to pthread_rwlock_rdlock'
/usr/local/lib/libre2.so: undefined reference topthread_rwlock_wrlock'
/usr/local/lib/libre2.so: undefined reference to pthread_rwlock_destroy'
/usr/local/lib/libre2.so: undefined reference topthread_rwlock_init'
/usr/local/lib/libre2.so: undefined reference to `pthread_rwlock_unlock'
collect2: error: ld returned 1 exit status
make: *** [testinstall] Error 1
Original comment by tobenot...@gmail.com
on 21 Feb 2014 at 4:12
Adding -pthread to the loader flags solved this for me.
Original comment by friedman...@gmail.com
on 13 Mar 2014 at 10:06
The same for me, using vagrant hashicorp/precise64. If add -pthread to LDFLAGS
then
make test
passes. make install requires sudo, but succeeds. make testinstall fails. And
any other c-app which requires re2 fails to compile in the same way. Wrong
paths for h-files?
Original comment by astarshi...@netsertive.com
on 18 Mar 2014 at 4:52
Comment for #5:
solved problems with another app by fixing prefix in Makefile to /usr before
make install
but make testinstall still not working
Original comment by astarshi...@netsertive.com
on 18 Mar 2014 at 9:26
having the same issue on vagrant hashicorp/precise64
Original comment by da...@bowery.io
on 5 Apr 2014 at 12:29
[deleted comment]
/tmp/cccTNGss.o: In function main':
testinstall.cc:(.text+0xce): undefined reference
tore2::FilteredRE2::FirstMatch(re2::StringPiece const&, std::vector > const&)
const'
This error can be fixed, just change your Makefile;
Because the compiler will first search libxxx.so file path folder, if not
found, search continues libxxx.a (static library).
so,you only need to comment or delete this line in Makefile "ln -sf
libre2.so.$(SONAME).0.0 $(DESTDIR)$(libdir)/libre2.so "
Original comment by huadong...@gmail.com
on 27 May 2014 at 4:49
So I tried looking for the lines in testinstall.cc that were causing the symbol
errors and I found out that the only line was on line 18:
18 - f.firstMatch(:abbccc:, ids);
I commented this line out (so that the FullMatch function below is still
called) and just ran g++ testinstall.cc -lre2 -pthread -o testinstall
(basically what the Makefile does) and I was able to get a binary successfully.
Although this might not really solve the problem, its good to know that we can
still use the RE2::Fullmatch and partial match functions
If I were to guess, maybe there is a dependency somewhere inside the
filtered_re2 module?
Original comment by veek...@gmail.com
on 28 Jul 2014 at 6:01
[deleted comment]
I changed the exported symbols in libre2.symbols to export the proper symbol.
Doing this caused the filtered_re2_test to fail the atoms.size() == 0 test in
SmallOrTest. The atoms vector contains "foo" and "bar". What is strange to me
is that from the comments in FilteredRE2 it seems that the vector *should*
contain foo and bar, and that it is the test itself which is wrong. Very
strange.
Original comment by pmeredit@gmail.com
on 12 Aug 2014 at 3:25
I had all of the same problems as the rest of you guys. But I fixed it with the
attached patch and then it seemed to work OK on my machine.
Original comment by matthew....@threatstream.com
on 4 Oct 2014 at 5:53
Attachments:
I'd happily submit the patch upstream but the commit workflow is so long,
complex, and Mercurial-proprietary it's beyond me to figure it out. Hopefully
somebody with upstream access can give me a hand with it.
Original comment by matthew....@threatstream.com
on 4 Oct 2014 at 5:55
it should be make by gcc 4.x but not 3.x,and then the
"obj/test/%","obj/dbg/test/%","obj/so/test/%" should be added
$(libdir)/libpthread.so.
It can be compiled by "make test".and tested by "make testinstall".
I failed in "testinstall.cc:(.text+0xce): undefined reference to
`re2::FilteredRE2::FirstMatch(re2::StringPiece const&, std::vector<int,
std::allocator<int> > const&) const'".when i note this func,the func FullMatch
work correctly.
Original comment by wangt...@gmail.com
on 13 Nov 2014 at 10:08
RE2 has moved to GitHub. I have not moved the issues over. If this issue is
still important to you, please file a new one at
https://github.com/google/re2/issues. Thank you.
Original comment by rsc@golang.org
on 11 Dec 2014 at 4:45
Original issue reported on code.google.com by
hazzl...@gmail.com
on 20 Jan 2014 at 9:16