<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 22 Jul 2019 at 12:17 PM, Steve Lhomme <<a href="mailto:robux4@ycbcr.xyz">robux4@ycbcr.xyz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2019-07-20 4:53, Roland Bewick wrote:<br>
> <br>
> On 19/07/2019 5:50 PM, Steve Lhomme wrote:<br>
>> On 2019-07-19 12:37, Roland Bewick wrote:<br>
>>><br>
>>> On 19/07/2019 5:12 PM, Steve Lhomme wrote:<br>
>>>> On 2019-07-19 12:07, Roland Bewick wrote:<br>
>>>>> Hi Steve, thanks for your reply.<br>
>>>>><br>
>>>>> On 19/07/2019 2:53 PM, Steve Lhomme wrote:<br>
>>>>>> Hi,<br>
>>>>>><br>
>>>>>> On 2019-07-19 6:04, Roland Bewick wrote:<br>
>>>>>>><br>
>>>>>>> Hi, I'm looking to use the inet_pton function within <br>
>>>>>>> modules\services_discovery\microdns.c<br>
>>>>>>><br>
>>>>>>> Unfortunately it looks to be defined twice when I cross compile <br>
>>>>>>> for Windows:<br>
>>>>>>><br>
>>>>>>> 1. in libmicrodns (compat/inet.c) - will only be declared if <br>
>>>>>>> defined (_WIN32) && !defined(HAVE_INET_NTOP)<br>
>>>>>><br>
>>>>>> On my win32 cross compilation (clang + mingw32) HAVE_INET_NTOP is <br>
>>>>>> set to 1 so this code is never compiled.<br>
>>>>>><br>
>>>>>>> 2. in libws2_32.a (I think from including winsock2.h?)<br>
>>>>>>><br>
>>>>>>> /opt/gcc-x86_64-w64-mingw32/x86_64-w64-mingw32/lib/libws2_32.a(dywbs00169.o):(.text+0x0): <br>
>>>>>>> multiple definition of `inet_pton'<br>
>>>>>>> /win64/vlc/contrib/x86_64-w64-mingw32/lib/libmicrodns.a(inet.o):/win64/libmicrodns/build/../compat/inet.c:60: <br>
>>>>>>> first defined here<br>
>>>>>><br>
>>>>>> When building VLC with the same configuration HAVE_INET_PTON is <br>
>>>>>> set and thus the compat function is never built either. The ws2_32 <br>
>>>>>> one is used.<br>
>>>>>><br>
>>>>>> So it seems rather an issue in your toolchain/build script. Are <br>
>>>>>> you using MSVC ? The 3.0 branch ?<br>
>>>>><br>
>>>>><br>
>>>>> I followed this docker guide:<br>
>>>>><br>
>>>>> <a href="https://gitlab.com/garfvl/daalenv/blob/master/doc/vlc.md" rel="noreferrer" target="_blank">https://gitlab.com/garfvl/daalenv/blob/master/doc/vlc.md</a> for win64 <br>
>>>>> with prebuilt contribs (tip #2 in the readme).<br>
>>>>><br>
>>>>> I’m not using MSVC.<br>
>>>>><br>
>>>>> I’m on the master branch.<br>
>>>>><br>
>>>>> Since I'm using the prebuilt libs and standard? build script for <br>
>>>>> win64, I'm worried other people might encounter this as well.<br>
>>>><br>
>>>> Maybe the docker uses an outdated version on mingw32 ? It seems very <br>
>>>> odd that `inet_pton` is defined in ws2_32 but not found in the headers.<br>
>>>><br>
>>>> Can you check your config.log to see what it says when checking for <br>
>>>> it ?<br>
>>><br>
>>> It looks like it's failing so HAVE_INET_PTON is not being set as <br>
>>> expected.<br>
>>><br>
>>> From line 13814:<br>
>>><br>
>>> configure:25828: checking for library containing inet_pton<br>
>>> configure:25859: x86_64-w64-mingw32-gcc -o conftest.exe -g -O2 <br>
>>> -I/win64/vlc/contrib/x86_64-w64-mingw32/include -mms-bitfields <br>
>>> -I/win64/vlc/contrib/x86_64-w64-mingw32/include <br>
>>> -D__USE_MINGW_ANSI_STDIO=1 -Wl,--nxcompat -Wl,--no-seh <br>
>>> -Wl,--dynamicbase -Wl,--high-entropy-va -Wl,--image-base,0x140000000 <br>
>>> -L/win64/vlc/contrib/x86_64-w64-mingw32/lib conftest.c >&5<br>
>>> /tmp/ccT0CMSB.o: In function `main':<br>
>>> /win64/vlc/win64/conftest.c:89: undefined reference to `inet_pton'<br>
>>> /win64/vlc/win64/conftest.c:89:(.text.startup+0xa): relocation <br>
>>> truncated to fit: R_X86_64_PC32 against undefined symbol `inet_pton'<br>
>>> collect2: error: ld returned 1 exit status<br>
>>> configure:25859: $? = 1<br>
>>> configure: failed program was:<br>
>>><br>
>>> ...<br>
>>><br>
>>> If needed, you can see the full config file below (1MB)<br>
>>><br>
>>> <a href="https://www.dropbox.com/s/m2rklvzyl1lkst6/config.log?dl=0" rel="noreferrer" target="_blank">https://www.dropbox.com/s/m2rklvzyl1lkst6/config.log?dl=0</a><br>
>><br>
>> Yes, there are many different checks but in the end it is found.<br>
>> You can see HAVE_INET_PTON is set to 1 afterwards up to the end of the <br>
>> script. So it should be set to that value in config.h as well.<br>
> <br>
> Yes, it's set to 1.<br>
> <br>
> But libmicrodns wasn't built by my system because I'm using the prebuilt <br>
> contribs. So does that mean in the nightly build HAVE_INET_PTON was set <br>
> to 0?<br>
<br>
Possibly yes. It's not recommended to use prebuilt contribs in general <br>
in case you know you have the same toolchain as the build bot. I would <br>
assume it is the case with the docker but it seems wrong. So you should <br>
build the contribs locally. It will take longer but at least it's <br>
guaranteed to work.</blockquote><div dir="auto"><br></div><div dir="auto">Ok, thanks :-)</div><div dir="auto"><br></div><div dir="auto">Roland</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a></blockquote></div></div>