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: gcc x86 - problem on library search order




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/

COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=i686'
/usr/lib/gcc/i686-pc-cygwin/5.3.0/collect2.exe -plugin /usr/lib/gcc/i686-pc-cygwin/5.3.0/cyglto_plugin.dll -plugin-opt=/usr/lib/gcc/i686-pc-cygwin/5.3.0/lto-wrapper.exe -plugin-opt=-fresolution=/tmp/ccqHx4mQ.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lcygwin -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --wrap _Znwj --wrap _Znaj --wrap _ZdlPv --wrap _ZdaPv --wrap _ZnwjRKSt9nothrow_t --wrap _ZnajRKSt9nothrow_t --wrap _ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t -Bdynamic --dll-search-prefix=cyg --large-address-aware --tsaware /usr/lib/crt0.o /usr/lib/gcc/i686-pc-cygwin/5.3.0/crtbegin.o -L/usr/lib/gcc/i686-pc-cygwin/5.3.0 -L/usr/lib/gcc/i686-pc-cygwin/5.3.0/../../../../i686-pc-cygwin/lib -L/usr/lib/w32api /tmp/ccHGOCXX.o -luuid -lgcc_s -lgcc -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 -lgcc_s -lgcc /usr/lib/default-manifest.o /usr/lib/gcc/i686-pc-cygwin/5.3.0/crtend.o /tmp/ccHGOCXX.o:uuid.c:(.text+0x16): undefined reference to `uuid_generate_random'
collect2: error: ld returned 1 exit status

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


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