Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by Anonymous Monk
on Nov 18, 2019 at 11:10 UTC ( [id://11108862]=note: print w/replies, xml ) Need Help??


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

What do you find when you search for undefined reference to `__imp_curl_global_init'? Does your libcurl.a mention imp_curl_global_init? Maybe you need to link against libcurl.dll.a?
  • Comment on Re: Can't call libcurl with Inline::C on Windows

Replies are listed 'Best First'.
Re^2: Can't call libcurl with Inline::C on Windows
by Anonymous Monk on Nov 19, 2019 at 02:26 UTC
    Thanks! I link to libcurl.dll.a, Inline can build a xs.dll successfully. but still failed:
    "C:\perl\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- +bb_pl_d714.bs blib\arch\auto\bb_pl_d714\bb_pl_d714.bs 644 Files found in blib\arch: installing files in blib\lib into architectu +re dependent library tree Installing C:\Users\Administrator\Downloads\curl-7.67.0_4-win64-mingw\ +curl-7.67.0-win64-mingw\_Inline\lib\auto\bb_pl_d714\bb_pl_d714.xs.dll Finished "make install" Stage Starting Cleaning Up Stage Finished Cleaning Up Stage Finished Build Compile Stage Had problems bootstrapping Inline module 'bb_pl_d714' Can't load 'C:\Users\Administrator\Downloads\curl-7.67.0_4-win64-mingw +\curl-7.67.0-win64-mingw\_Inline\lib/auto/bb_pl_d714/bb_pl_d714.xs.dl +l' for module bb_pl_d714: load_file:The specified module could not be found a +t C:/perl/perl/lib/DynaLoader.pm line 193. at C:/perl/perl/site/lib/Inline.pm line 541. at bb.pl line 6. BEGIN failed--compilation aborted at bb.pl line 6.
      Had problems bootstrapping Inline module 'bb_pl_d714'

      I think you simply need to add the location of the libcurl dll to your PATH, as that dll needs to be located at runtime.
      That location is probably:
      C:\Users\Administrator\Downloads\curl-7.67.0_4-win64-mingw\curl-7.67.0 +-win64-mingw\bin
      This script (almost identical to yours) worked fine for me on Windows, building against curl-7.65.0-2, as provided by the MSYS2 project:
      use strict; use warnings; use Inline 'Config' => BUILD_NOISY => 1, CLEAN_AFTER_BUILD => 0; use Inline 'C' => 'Config' => libs => '-LC:\_64\msys64\mingw64\lib -lc +url.dll', inc => '-IC:\_64\msys64\mingw64\\include'; use Inline 'C' => <<'CODE'; #include <errno.h> #include <stdlib.h> #include <string.h> #ifndef WIN32 #include <unistd.h> #endif #include <curl/curl.h> int init(){ CURLM *cm; curl_global_init(CURL_GLOBAL_WIN32); printf("SUCCESS !!\n"); return 0; } CODE init();
      After the build completed it output "SUCCESS !!".

      Cheers,
      Rob
        Many thanks Rob! You make me out of a mess!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found