This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libuuid


>> 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]