in reply to Re^4: Can't call libcurl with Inline::C on Windows
in thread Can't call libcurl with Inline::C on Windows
I'll try to build latest Net-Curl with perl-5.30 later today, and see how it goes for me.-lcurl -lrtmp -lwinmm -lcares -lwldap32 -lidn -liconv -lssh2 -lws2_32 + -lgdi32 -lssl -lcrypto -lcrypt32 -lz
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Can't call libcurl with Inline::C on Windows
by syphilis (Archbishop) on Nov 20, 2019 at 00:39 UTC | |
Here's how it went for me. First up, I added the location (C:\_64\msys64\mingw64\bin) of the libcurl dll to my path: That, of course, also makes a whole lot of other stuff (such as pkg-config) available. Then I conceal the curl static lib (C:\_64\msys64\mingw64\lib\libcurl.a) by changing its extension to ".a_hide". This ensures that the Net-Curl-0.41 build links to the import lib (C:\_64\msys64\mingw64\lib\libcurl.dll.a). Next, run the Makefile.PL: Followed by: The build has succeeded (for some definition of "succeeded") but there are some warnings, and the module is unloadable: I don't know why that happens, or how to fix it. The compiler warning about conversion from 'long long unsigned int' to 'int' rings an alarm bell. And I see places in the generated Curl.c where 'IV' is cast to 'int', which creates a cacophony of alarm bells. Cheers, Rob | [reply] [d/l] [select] |
by xiaoyafeng (Deacon) on Nov 20, 2019 at 03:58 UTC | |
I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction | [reply] |
by syphilis (Archbishop) on Nov 20, 2019 at 12:30 UTC | |
Yes, that probably makes it a bit simpler - certainly a lot simpler than the builds I did a couple of years ago against static libraries that I had built from source. I finally solved the problem regarding the "loadable library and perl binaries" mismatch - and in so doing, I discovered that I had faced (and solved) the exact same problem when I built Net-Curl-0.37. There's a line in the Makefile.PL: That change then also brings about the need to patch Curl.xs: I got rid of the overflow in conversion from 'long long unsigned int' to 'int' warning by patching Curl_multi.xsh: though it doesn't seem to make any difference to the way that the test suite behaves .... and the test suite doesn't behave very well. A lot of the tests fail or hang. And the examples scripts hang or crash - except for examples/04-share-threads.pl (which runs fine). The Net-Curl-0.41 test suite covers much more than the Net-Curl-0.37 suite did. 0.37 passed all of its tests, and 0.41 still passes the same tests. The problems are with the other tests in 0.41 (ie the ones that weren't in 0.37). I've no idea how useful Net-Curl is on Windows - I think it's a good idea to stick with Inline::C if you can get it to do what you need. I also built Net-Curl-0.41 with Strawberry Perl 5.30.0.1 - again, building against the MSYS2 libraries. I get identical results with Strawberry Perl - which is to be expected. Strawberry Perl's perl/bin/pkg-config.bat doesn't automatically find the Curl library, so I renamed it to pkg-config.bat_hide. With that done, the MSYS2 mingw64/pkg-config.exe gets used instead, and the Curl library is found. Cheers, Rob | [reply] [d/l] [select] |
by xiaoyafeng (Deacon) on Nov 22, 2019 at 05:30 UTC | |
by swl (Prior) on Nov 20, 2019 at 08:30 UTC | |
This might be tangential, but have you tried using Alien::curl and forcing a shared install so it downloads and compiles a recent version? Access to the libs is then via Alien::curl->libs and similar. See the examples in the Alien::curl and Alien::Base documentation. | [reply] [d/l] |
by xiaoyafeng (Deacon) on Nov 22, 2019 at 05:12 UTC | |
by swl (Prior) on Nov 22, 2019 at 22:36 UTC | |