gcc x86 - problem on library search order

Marco Atzeri marco.atzeri@gmail.com
Mon Apr 25 19:34:00 GMT 2016


Visible on 32bit and not present on 64bit

$ cat uuid.c
#include <uuid/uuid.h>

int main ()
{
     uuid_t out;
     uuid_generate_random(out);
     return 0;
}


$ gcc uuid.c -luuid
/tmp/ccLlmFMf.o:uuid.c:(.text+0x16): undefined reference to 
`uuid_generate_random'
collect2: error: ld returned 1 exit status

$ gcc uuid.c -luuid -L /usr/lib


The problem seems "/usr/lib/w32api" searched
before "/usr/lib"

$ cygcheck -l w32api-runtime |grep libuuid.
/usr/lib/w32api/libuuid.a

$ cygcheck -l libuuid-devel |grep libuuid.dll
/usr/lib/libuuid.dll.a

$ cygcheck -c gcc-core
Cygwin Package Information
Package              Version        Status
gcc-core             5.3.0-4        OK


Marco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list