Обсуждение: Link error from libpq++ on RedHat 6.0 and Postgres 6.5.1
<pre> Hallo, I received the following error when compiling C++ code (using -lpq++ -lpq -lcrypt) with Postgres 6.5.1 (last RPM files) on Red Hat 6.0 (glibc 2) :</pre> /usr/lib/libpq++.so: undefined reference to `clone__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i03Rep'<p>/usr/lib/libpq++.so: undefinedreference to `__dl__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i03RepPv' <p>/usr/lib/libpq++.so:undefined reference to `__eh_pc' collect2: ld returned 1 exit status <p>Some helps ? <p>Thanks inadvance. <br />Claudio Cicognani <br /><braintech@btstore.com> <br /> <br /> <br />
> I received the following error when compiling C++ code > (using -lpq++ -lpq -lcrypt) with Postgres > 6.5.1 (last RPM files) on Red Hat 6.0 (glibc 2) : > /usr/lib/libpq++.so: undefined reference to > `clone__Q2t12basic_string3ZcZt18...' > /usr/lib/libpq++.so: undefined reference to `__eh_pc' collect2: ld > returned 1 exit status > Some helps ? Ah, this looks familiar! I built the rpms using the RH5.2 gcc/g++ compiler. RH6.0 has the egcs compiler set; you are seeing the "mangled" name of a routine required by the older library I built which is not present in the newer support libraries. I believe that the only fix is to rebuild the rpms from source on your machine, so that libpq++ is constructed using your newer compiler. It is pretty easy; just get the src rpm from postgresql.org and then use either rpm --rebuild postgresql-6.5.1-2.src.rpm or rpm -ivv postgresql-6.5.1-2.src.rpm cd /usr/src/redhat/SPECS rpm -ba postgresql-6.5.1.spec Another possibility is to pick up Lamar Owen's binary rpms (look at the hackers or ports archive for details); I think he had a RH6.0 machine to build with. btw, I'm just now transferring new rpms to postgresql.org which fix some reported problems for missing files in the libpq++ interface (Lamar, we will need to sync our spec files again). The new files are labeled postgresql*-6.5.1-2.*.rpm. Good luck. - Thomas -- Thomas Lockhart lockhart@alumni.caltech.edu South Pasadena, California
Thomas Lockhart wrote: > I believe that the only fix is to rebuild the rpms from source on your > machine, so that libpq++ is constructed using your newer compiler. It One caveat with rebuilding -- you must have python-devel installed, which is not by default installed under 6.0, unless you select it in the development libraries. > Another possibility is to pick up Lamar Owen's binary rpms (look at > the hackers or ports archive for details); I think he had a RH6.0 > machine to build with. I have a machine to build with -- just haven't gotten the binaries up to the site. Am waiting on 6.5.2 before doing another released build. > (Lamar, we will need to sync our spec files again). The new files are > labeled postgresql*-6.5.1-2.*.rpm. Got them; will sync up. Lamar Owen WGCR Internet Radio