On Fri, Jan 13, 2012 at 8:07 AM, Erik van Pienbroek
<e...@vanpienbroek.nl> wrote:
> Kai Tietz schreef op do 12-01-2012 om 22:54 [+0100]:
>> 2012/1/12 Kyle <kshawk...@gmail.com>:
>> > I'm getting:
>> > trunk/mingw-w64-crt/stdio/mingw_pformat.c:476: undefined reference to
>> > `wcslen'
>>
>> As wcslen is in libmsvcrt.a present, it seems to me like a broken
>> build of runtime.  Or binutils is broken, but the link-order used - as
>> you have shown it - looks correct.
>>
>
> Hey,
>
> I've been bitten by this issue too while updating the base toolchain
> packages for Fedora. First I've updated to gcc 4.7 (20120106 snapshot),
> then binutils head (20120113 snapshot) and then mingw-w64 trunk
> (20120112 snapshot).
>
> Now when I try to compile a minimal .c file the following linker error
> occurs for the x86_64 target:
>
> $ cat test.c
> int main() { return 0; }
>
> $ x86_64-w64-mingw32-gcc test.c -o test.exe
> /usr/x86_64-w64-mingw32/sys-root/mingw/lib/../lib/libmingwex.a(lib64_libmingwex_a-mingw_pformat.o):(.text+0x1e83):
>  undefined reference to `wcslen'
>
> Building binaries for the i686 target work just fine.
>
> Is it also needed to rebuild gcc with the new crt in place?

Only if the ABI changed in the CRT which I doubt.

It appears to me to be a default library ordering problem.  -lmsvcrt
needs to follow -lmingwex in the linker parameter order.  Add -v to
your gcc options to see the order of default libraries being passed to
the linker.

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to