Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Can't call libcurl with Inline::C on Windows

by Anonymous Monk
on Nov 19, 2019 at 01:00 UTC ( [id://11108884]=note: print w/replies, xml ) Need Help??


in reply to Re: Can't call libcurl with Inline::C on Windows
in thread Can't call libcurl with Inline::C on Windows

No,Net:::Curl is only for Linux.
  • Comment on Re^2: Can't call libcurl with Inline::C on Windows

Replies are listed 'Best First'.
Re^3: Can't call libcurl with Inline::C on Windows
by syphilis (Archbishop) on Nov 19, 2019 at 02:54 UTC
    Net:::Curl is only for Linux

    I've successfully built Net-Curl-0.37 on Windows in the past (for perls 5.8.8 through to 5.24.x).
    I haven't checked to see whether there's a later version of Net-Curl, and I haven't bothered building it on later versions of perl.
    I can see that I had to hack the Makefile.PL a bit (I could provide details if there's any interest), and I also needed the following patch to Curl.xs:
    --- Curl.xs_orig 2015-06-22 19:33:33 +1000 +++ Curl.xs 2015-06-22 19:51:00 +1000 @@ -17,6 +17,15 @@ #include "perl.h" #include "XSUB.h" +#ifdef __MINGW32__ +#undef fread +#undef fwrite +#endif + #include <curl/curl.h> #include <curl/easy.h> #include <curl/multi.h>
    Not so sure that it passed its test suite entirely, but it was certainly generally usable.

    Cheers,
    Rob

      Hi Rob,

      do you try the newest Net::Curl with perl 5.30? I've tried to install Net::Curl on windows as your suggested on github, but failed. the Makefile could build successfully, and not PerlSIO complain, but when running gmake, it complain not reference to zlibversion etc.
      Makefile.PL: #CCFLAGS => $devel_cflags . ' ' . $curl{cflags} . $bi +ts, CCFLAGS => $Config::Config{ccflags}.' '.$devel_cflags +. ' ' .$curl{cflags}.$bits, Curl.xs: #ifdef fread #undef fread #endif #ifdef fwrite #undef fwrite #endif Build Makefile&#65306; Found libcurl version 7.66.0 Reading C:/perl/perl/site/lib/auto/share/dist/Alien-curl/include/curl/ +curl.h (gcc -E -IC:/perl/perl/site/lib/auto/share/ dist/Alien-curl/include -DCURL_STATICLIB C:/perl/perl/site/lib/auto/sh +are/dist/Alien-curl/include/curl/curl.h) Skipping '#define CURLINC_CURL_H': does not define a symbol at Makefil +e.PL line 319, <H> line 2. Skipping '#define CURL_STRICTER': does not define a symbol at Makefile +.PL line 319, <H> line 34. Skipping '# define CURL_EXTERN': does not define a symbol at Makefile +.PL line 319, <H> line 116. Skipping '# define CURL_EXTERN': does not define a symbol at Makefile +.PL line 319, <H> line 128. Skipping '#define CURL_DID_MEMORY_FUNC_TYPEDEFS': does not define a sy +mbol at Makefile.PL line 319, <H> line 446. Reading C:/perl/perl/site/lib/auto/share/dist/Alien-curl/include/curl/ +multi.h (gcc -E -IC:/perl/perl/site/lib/auto/share /dist/Alien-curl/include -DCURL_STATICLIB C:/perl/perl/site/lib/auto/s +hare/dist/Alien-curl/include/curl/multi.h) Skipping '#define CURLINC_MULTI_H': does not define a symbol at Makefi +le.PL line 319, <H> line 2. CURLALTSVC_ALTUSED missing CURLE_AUTH_ERROR unexpected CURLINFO_RETRY_AFTER unexpected CURLOPT_SASL_AUTHZID unexpected CURLVERSION_SIXTH unexpected CURL_HTTP_VERSION_3 unexpected CURL_VERSION_HTTP3 unexpected -> found 898 constants (should be 893) Writing const-defenums-h.inc Writing const-curl-xs.inc Writing const-easy-xs.inc Writing const-form-xs.inc Writing const-multi-xs.inc Writing const-share-xs.inc Writing curl-Easy-c.inc Writing curl-Easy-xs.inc Writing curl-Form-c.inc Writing curl-Form-xs.inc Writing curl-Multi-c.inc Writing curl-Multi-xs.inc Writing curl-Share-c.inc Writing curl-Share-xs.inc Writing lib/Net/Curl/examples.pod <- examples/01-curl-transport.pl <- examples/02-multi-simple.pl <- examples/03-multi-event.pl <- examples/04-share-threads.pl <- examples/05-irssi-downloader.pl Writing lib/Net/Curl/Compat.pm Checking if your kit is complete... Looks good Generating a gmake-style Makefile Writing Makefile for Net::Curl Writing MYMETA.yml and MYMETA.json When run gmake: "C:\perl\perl\bin\perl.exe" -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Net::Curl\", 'DLBASE' => 'Curl', 'DL_FUN +CS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" g++.exe Curl.def -o blib\arch\auto\Net\Curl\Curl.xs.dll -mdll -s -L"C: +\perl\perl\lib\CORE" -L"C:\perl\c\lib" Curl.o "C :\perl\perl\lib\CORE\libperl530.a" "C:\perl\perl\site\lib\auto\share\d +ist\Alien-curl\lib\libcurl.a" "C:\perl\c\x86_64-w6 4-mingw32\lib\libmoldname.a" "C:\perl\c\x86_64-w64-mingw32\lib\libkern +el32.a" "C:\perl\c\x86_64-w64-mingw32\lib\libuser3 2.a" "C:\perl\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\perl\c\x86_64-w +64-mingw32\lib\libwinspool.a" "C:\perl\c\x86_64-w6 4-mingw32\lib\libcomdlg32.a" "C:\perl\c\x86_64-w64-mingw32\lib\libadva +pi32.a" "C:\perl\c\x86_64-w64-mingw32\lib\libshell 32.a" "C:\perl\c\x86_64-w64-mingw32\lib\libole32.a" "C:\perl\c\x86_64- +w64-mingw32\lib\liboleaut32.a" "C:\perl\c\x86_64-w 64-mingw32\lib\libnetapi32.a" "C:\perl\c\x86_64-w64-mingw32\lib\libuui +d.a" "C:\perl\c\x86_64-w64-mingw32\lib\libws2_32.a " "C:\perl\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\perl\c\x86_64-w64-mi +ngw32\lib\libwinmm.a" "C:\perl\c\x86_64-w64-mingw3 2\lib\libversion.a" "C:\perl\c\x86_64-w64-mingw32\lib\libodbc32.a" "C: +\perl\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\ perl\c\x86_64-w64-mingw32\lib\libcomctl32.a" -Wl,--enable-auto-image-b +ase C:/perl/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w +64-mingw32/bin/ld.exe: C:\perl\perl\site\lib\auto\ share\dist\Alien-curl\lib\libcurl.a(libcurl_la-version.o):version.c:(. +text+0x69): undefined reference to `zlibVersion' C:/perl/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w +64-mingw32/bin/ld.exe: C:\perl\perl\site\lib\auto\ share\dist\Alien-curl\lib\libcurl.a(libcurl_la-version.o):version.c:(. +text+0x8d): undefined reference to `idn2_check_ver sion' C:/perl/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w +64-mingw32/bin/ld.exe: C:\perl\perl\site\lib\auto\ share\dist\Alien-curl\lib\libcurl.a(libcurl_la-version.o):version.c:(. +text+0x9c): undefined reference to `idn2_check_ver sion' ....... hundrends of complain undefined reference to.....




      I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

        ... it complain not reference to zlibversion etc

        Looks like you're trying to build against a static libcurl (libcurl.a).
        It's probably easier to build against libcurl.dll.a import library, assuming you have such a file.
        If you're lucky, it might be as simple as renaming libcurl.a to (eg) libcurl.a_static && then copying libcurl.dll.a to libcurl.a.

        When I've built Net-Curl-0.37 against static libraries, I've had to specifically link to:
        -lcurl -lrtmp -lwinmm -lcares -lwldap32 -lidn -liconv -lssh2 -lws2_32 + -lgdi32 -lssl -lcrypto -lcrypt32 -lz
        I'll try to build latest Net-Curl with perl-5.30 later today, and see how it goes for me.

        Cheers,
        Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108884]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-24 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found