gcc x86 - problem on library search order

JonY 10walls@gmail.com
Tue Apr 26 17:29:00 GMT 2016


On 4/26/2016 20:10, Marco Atzeri wrote:
> 
> 
> On 26/04/2016 12:16, JonY wrote:
>> On 4/26/2016 01:46, Marco Atzeri wrote:
>>> 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
>>>
>>
>> Pretty sure I removed the patch that does that, not sure where it gets
>> in from. It isn't in the specs file either.
>>
>> -Wl,-v does say it is from gcc.
> 
> may be from "COLLECT_GCC_OPTION" as "LIBRARY_PATH" has the right order
> 
> LIBRARY_PATH=/usr/lib/gcc/i686-pc-cygwin/5.3.0/:/usr/lib/gcc/i686-pc-cygwin/5.3.0/../../../../i686-pc-cygwin/lib/:/usr/lib/:/lib/:/usr/lib/w32api/
> 

In -Wl,-v, looks like 64bit gcc too has -L/usr/lib/w32api, however, it
is "-L/usr/lib/../lib -L/lib/../lib
-L/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/lib
-L/usr/lib/w32api", so it comes out correct eventually. The 32bit
version is lacking that.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160426/0101b537/attachment.sig>


More information about the Cygwin mailing list