X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Message-ID: <3ee066b40710091923q612ff18s469961f5ed363d76@mail.gmail.com> Date: Wed, 10 Oct 2007 07:53:15 +0530 From: "antony baxter" To: cygwin AT cygwin DOT com Subject: Re: libuuid MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l9A2NO99003851 >> I'm trying to compile a PostgreSQL module that relies on libuuid. I've >> found a number of previous discussions about this lib on the mailing >> list which indicate that in general we must use the Win32api version >> libuuid.a found in /usr/lib/w32api >> >> The source of the module can be found here: >> >> http://code.google.com/p/polarrose-postgresql-uuid/ >> >> and the output of make is: >> >> gcc -O2 -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Winline >> -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing >> -I. -I/usr/include/postgresql/server -I/usr/include/postgresql/internal >> -c -o uuid.o uuid.c >... >> dlltool --export-all --output-def uuid.def uuid.o > >> dllwrap -o uuid.dll --def uuid.def uuid.o >> /usr/lib/postgresql/pgxs/src/makefiles/../../src/utils/dllinit.o >> -L/usr/lib -lpostgres >> uuid.o:uuid.c:(.text+0xe): undefined reference to `_uuid_compare' >... >> I've tried: >> >> dllwrap -o uuid.dll --def uuid.def uuid.o >> /usr/lib/postgresql/pgxs/src/makefiles/../../src/utils/dllinit.o >> -L/usr/lib -lpostgres -L/usr/lib/w32api -luuid > > Try: > > dllwrap -o uuid.dll --def uuid.def uuid.o > /usr/lib/postgresql/pgxs/src/makefiles/../../src/utils/dllinit.o > -L/usr/lib -lpostgres -Wl,-Bstatic -luuid -Wl,-Bdynamic > > I don't think you need the -L/usr/lib/w32api but maybe you do, and the > change can also be written as -Wl,-Bstatic,-luuid,-Bdynamic . > > Explanation: libuuid.a is a static library, you have to explicitly link > it otherwise the tools look only for dynamic libraries. René, Thanks very much for replying so quickly. I've just tried: dllwrap -o uuid.dll --def uuid.def uuid.o /usr/lib/postgresql/pgxs/src/../../src/utils/dllinit.o -L/usr/lib -lpostgres -Wl,-Bstatic -luuid -Wl,-Bdynamic dllwrap -o uuid.dll --def uuid.def uuid.o /usr/lib/postgresql/pgxs/src/../../src/utils/dllinit.o -L/usr/lib -lpostgres -L/usr/lib/w32api -Wl,-Bstatic -luuid -Wl,-Bdynamic and dllwrap -o uuid.dll --def uuid.def uuid.o /usr/lib/postgresql/pgxs/src/../../src/utils/dllinit.o -L/usr/lib -lpostgres -L/usr/lib/w32api -Wl,-Bstatic,-luuid,-Bdynamic All three give the same errors: uuid.o:uuid.c:(.text+0xe): undefined reference to `_uuid_compare' uuid.o:uuid.c:(.text+0x55): undefined reference to `_uuid_generate_random' uuid.o:uuid.c:(.text+0x98): undefined reference to `_uuid_parse' uuid.o:uuid.c:(.text+0x174): undefined reference to `_uuid_unparse_lower' uuid.o:uuid.c:(.text+0x2fd): undefined reference to `_uuid_unparse_lower' collect2: ld returned 1 exit status dllwrap: gcc exited with status 1 Probably should have mentioned: latest Cygwin DLL, Cygwin (not native Windows) PostgreSQL 8.1.4, latest w32api. Thanks again Ant. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/