compile error undefined reference to `__gxx_personality_v0'
Ubuntu 16.04. I cannot use the debian 9.4 bin file because it wants GLIBCXX_3.4.22 and I'm vary to update that from toolchain/test. So, I'm trying to compile from source webalizer-src-4-3-2-1.zip. Had to install libgd-dev and libmaxminddb-dev, but now I'm stuck with a linker error. Could this be an error actually in a header file or in the Makefile? The error is:
build/util_url.o:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'
One reference says that it wants to use the wrong linker (g++ instead of gcc): https://stackoverflow.com/questions/6045809/link-error-undefined-reference-to-gxx-personality-v0-and-g
I have no idea how to resolve this.
(There are also a lot of other "undefined reference" errors from several *.cpp, but they don't terminate the make run. Maybe could create problems at runtime, anyway?)
Thanks!
Comments (14)
-
repo owner -
repo owner For Debian I installed these packages:
- libmaxminddb-dev
- libgd-dev
- zlib1g-dev
- libdb++-dev
-
repo owner - changed status to open
-
Hi, many thanks for the very quick answer! I added libdb++-dev. zlib1g-dev was already installed, probably as a dependency. Then I replaced all $(CC) with $(CXX). However, now I get an error in logfile.cpp: undefined reference to `gzseek'. According to some research the gz functions should be in zlib1g-dev. But I have that installed already. zlib1g-dev is already the newest version (1:1.2.8.dfsg-2ubuntu4.1). This reference mentions a slight change to the build line: https://stackoverflow.com/questions/9700414/compilation-problems-with-zlib LD might be a hint?
About other undefined references. I get a lot in database.cpp: undefined reference to
Dbc::close()', undefined reference to
Dbt::~Dbt()'. Do I need some Berkeley db devel lib there? Thanks a lot!(There are also several warnings in dns_resolv.cpp about type: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’.)
Edit: I tried CC_LDFLAGS := -lz and CC_LDFLAGS += -lz No change.
Edit: Hm, actually, maybe the change to $(CXX) isn't the right thing to do? Earlier it got thru until the end (util_url.cpp is the last in the source list). I'm not sure, though, if this is a completely bogus comment by me, haven't been compiling on Linux for some time. Or should I change something here: LIBS := stdc++ dl pthread db_cxx gd z maxminddb to something like-> LIBS := stdc++ dl pthread db_cxx gd z lz gz maxminddb ?
-
repo owner There are also several warnings in dns_resolv.cpp about type: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘long unsigned int’
Could it be that the source got mixed up somehow with another version? There is no
%x
indns_resolv.cpp
.These are the packages I have installed on my Debian machine. You need regular and development versions of them. Sorry, I should have been more clear before.
libmaxminddb-dev:amd64 1.2.0-1+b1 libmaxminddb0:amd64 1.2.0-1+b1 zlib1g:amd64 1:1.2.8.dfsg-5 zlib1g-dev:amd64 1:1.2.8.dfsg-5 libdb++-dev:amd64 5.3.1 libdb5.3:amd64 5.3.28-12+deb9u1 libdb5.3++:amd64 5.3.28-12+deb9u1 libdb5.3++-dev 5.3.28-12+deb9u1 libdb5.3-dev 5.3.28-12+deb9u1 libgd-dev:amd64 2.2.4-2+deb9u2 libgd3:amd64 2.2.4-2+deb9u2 g++ 4:6.3.0-4 g++-6 6.3.0-18+deb9u1 gcc 4:6.3.0-4 gcc-6 6.3.0-18+deb9u1 gcc-6-base:amd64 6.3.0-18+deb9u1
If you have similar packages and it still doesn't work, I will need to install Ubuntu to try it out. This might take a couple of days. Let me know where you are after checking all of the above.
-
repo owner Oh, sorry, I see
%x
indns_resolv.cpp
. I missed the formatting code. Yes, it's a bug. For some reason it doesn't get reported on my 64-bit build on Debian. -
Ah, ok, good you found that one :-). But it's not the problem stopping me from building it. My lib versions are mostly a bit lower with the exception of maxminddb. The main difference might be the compiler version. I have 5.3.1, not 6+. libmaxminddb-dev 1.3.2-0+maxm zlib1g-dev:amd 1:1.2.8.dfsg libdb++-dev:am 1:5.3.21~exp libdb5.3*:amd64 5.3.28-11ubu libgd-dev:amd6 2.2.5-5+ubun + non-devel versions of all of them. (version output was truncated by dpkg table layout)
There is a good tutorial on how to upgrade to gcc-6 in parallel here: https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91 But the repo has 6.5.0. Do you think it makes sense to try that? Or do you think it's something else? I don't understand why it doesn't find the zlib functions.
-
repo owner Let me install Ubuntu and give it a try.
-
repo owner Took me a bit to find the problem. In addition to changing
$(CC)
to$(CXX)
, locate this fragment:# # build/webalizer # $(BLDDIR)/$(TARGET): $(OBJS) $(CC) -o $@ $(CC_LDFLAGS) $(LIBDIRS) $(LIBS) $(addprefix $(BLDDIR)/,$(OBJS))
, move
$(LIBS)
to the end of the line, like this:$(CXX) -o $@ $(CC_LDFLAGS) $(LIBDIRS) $(addprefix $(BLDDIR)/,$(OBJS)) $(LIBS)
Run
make clean
to make sure all previous object files have been removed and it should then build fine. -
Hello, thank you very much. I had fiddled with that line but had tried moving other variables to the end. I did as you suggested and it built fine. Thanks a lot.
However, now I have a problem when running, not sure if I should open a new bug as I suppose it may not be a bug but something wrong I'm doing. As I couldn't build StoneSteps I started experimenting with awffull, another derivative of webalizer, in the meantime. I've now taken over the config files I created for it and learned that some keywords I use have changed (GeoIP, GeoIPDatabase, Top404Errors, All404Errors and this one has no equivalent: GroupAndHideAgent). I can change those. But there is one keyword that has not changed but I'm getting a warning nevertheless:
Warning: Invalid keyword "IncrementalName"
And I have a second problem concerning the logfile format. It seems that StoneSteps webalizer doesn't like what awffull or normal webalizer have processed just fine. I'm using the "combined" logformat as always.
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
Won't this fit?
I also have a question about GeoIP. This is going to use the new mmdb databases from Maxmind? Is it correct that if I want only GeoIP resolution I set the following:
DNSCache don't specify (can I set it to 0 or no or so or really have to omit it?) DNSChildren 1 (or greater) GeoIPDBPath /path
Thanks!
-
repo owner If you could create a new issue for these questions, it would help to keep issues self-contained. I will change
Makefile
and close this one once I had a chance to test it on other flavors of Linux.Thanks
-
repo owner This is going to use the new mmdb databases from Maxmind?
Yes, either country or city database should work. If you want city names in your reports, you need to enable them with
GeoIPCity
.With regards to configuration, yes that will work. Depending on how fast your machine is, 1 or 2 threads should do fine. GeoIP look-ups are fast and don't need a lot of threads. You can leave
DNSCache
blank if you don't filter out spammers. Otherwise you might want to enable it and addDNSLookups
asno
to prevent actual DNS resolution, which I recommend not to use. This way it will carry spammer information from a month to a month. -
repo owner - changed status to resolved
-
repo owner - changed status to closed
- Log in to comment
Can you replace
$(CC)
with$(CXX)
inMakefile
and try again?