Thanks for the tip @Shardik, but Linux and Mac work.
It's only M$ that's giving me head aches.
curl_easy_setopt fails on 64 bit CentOS 6
Re: curl_easy_setopt fails on 64 bit CentOS 6
the command was right for creating an import library
you can check the imports generated in the lib file using podump curl.lib /IMPORTS
did you try Import on windows instead of ImportC
and you may need to alias the Imports if they're decorated with an underscore on windows
Import
curl_easy_setopt(curl, tag, value) as "_curl_easy_setopt"
...
you can check the imports generated in the lib file using podump curl.lib /IMPORTS
did you try Import on windows instead of ImportC
and you may need to alias the Imports if they're decorated with an underscore on windows
Import
curl_easy_setopt(curl, tag, value) as "_curl_easy_setopt"
...
Windows 11, Manjaro, Raspberry Pi OS


Re: curl_easy_setopt fails on 64 bit CentOS 6
Sorry, my understanding was that you have difficulties with the Linux version, especially as Linux expert idle tried to help you...mariosk8s wrote:Thanks for the tip @Shardik, but Linux and Mac work.
I had to experience the same head aches when generating the libcurl.lib file for Windows...mariosk8s wrote:It's only M$ that's giving me head aches.

This worked for me to generate a usable libcurl.lib for x86 Windows:
- Download the developer version curl-7.30.0-devel-mingw32 from here (this is the 32 bit version).
- Decompress the downloaded archive
- Change into the \lib folder
- Edit libcurl.def
- Insert the following line as top line
LIBRARY libcurl
- Save libcurl.def
- For ease of operation copy polib.exe from PureBasic's compiler folder to libcurl's lib folder
- Open console
- CD into libcurl's lib folder
- Generate libcurl.lib:
> polib /DEF:libcurl.def /OUT:libcurl.lib /MACHINE:x86
- mariosk8s
- Enthusiast
- Posts: 103
- Joined: Wed Apr 06, 2011 11:37 am
- Location: Hüfingen, Germany
- Contact:
Re: curl_easy_setopt fails on 64 bit CentOS 6
First of all, thanks for your help guys.
@Shardik I managed to create libcurl.lib without a problem, it's subsequent linking that fails. I'm using libcurl built from source 7.32 using mingw. I did not manage to find a libcurl.def anywhere in there through.
@idle Here's what podump reports
The first thing i noticed is that the lib uses the original lib name, which i later changed from libcurl-4.dll to libcurl.dll. Making a copy so i have both and then running yields no results either.
So here i'm actually trying to make a lib out of my object file. Only the C code on top of this post is involved. PB is not yet involved.
On the PB side i'm getting the same error. It can find the functions in my wrapper just fine. It's the wrapper's use of curl_easy_setopt that fails to resolve when linking. There's no PB code directly referencing curl_easy_setopt.
I never dreamed, it would be such a bitch making a lib on Windows.
@Shardik I managed to create libcurl.lib without a problem, it's subsequent linking that fails. I'm using libcurl built from source 7.32 using mingw. I did not manage to find a libcurl.def anywhere in there through.
@idle Here's what podump reports
Code: Select all
Dump of libcurl.lib
File type: LIB
...
libcurl-4.dll: curl_easy_send (curl_easy_send)
libcurl-4.dll: curl_easy_setopt (curl_easy_setopt)
libcurl-4.dll: curl_easy_strerror (curl_easy_strerror)
...
Code: Select all
polink.exe -DLL rfsetopt.o -OUT:rfsetopt.dll -DEFAULTLIB:/path/to/libcurl.lib -NOENTRY
POLINK: error: Unresolved external symbol '_curl_easy_setopt'.
POLINK: fatal error: 1 unresolved external(s).
[
On the PB side i'm getting the same error. It can find the functions in my wrapper just fine. It's the wrapper's use of curl_easy_setopt that fails to resolve when linking. There's no PB code directly referencing curl_easy_setopt.
I never dreamed, it would be such a bitch making a lib on Windows.

Re: curl_easy_setopt fails on 64 bit CentOS 6
As I emphasized above you have to download the developer version which definately contains libcurl.def (my above link was to the older version 7.30.0). Here is the link to the newest developer version containing libcurl.def:mariosk8s wrote:@Shardik I managed to create libcurl.lib without a problem, it's subsequent linking that fails. I'm using libcurl built from source 7.32 using mingw. I did not manage to find a libcurl.def anywhere in there through.
http://curl.haxx.se/gknw.net/7.32.0/dis ... ingw32.zip
I would nevertheless advise to generate a new libcurl.lib because I also experienced problems with subsequent linking which all vanished after generating a proper libcurl.lib as described above...

-
- Enthusiast
- Posts: 792
- Joined: Sat Aug 09, 2003 3:13 am
- Location: 90-61-92 // EU or ASIA
- Contact:
Re: curl_easy_setopt fails on 64 bit CentOS 6
http://curl.haxx.se/docs/faq.html#Link_ ... ing_libcur
it is needed: libcurl_imp.lib ( download at: https://github.com/bitmovin/libdash/tre ... ibcurl/lib )
it is needed: libcurl_imp.lib ( download at: https://github.com/bitmovin/libdash/tre ... ibcurl/lib )
Code: Select all
ImportC "libcurl_imp.lib"
curl_easy_setopt(curl, tag, value) As "_curl_easy_setopt"
EndImport
curl_easy_setopt(0,0,0)
- mariosk8s
- Enthusiast
- Posts: 103
- Joined: Wed Apr 06, 2011 11:37 am
- Location: Hüfingen, Germany
- Contact:
Re: curl_easy_setopt fails on 64 bit CentOS 6
Ah, so it's generated during the build then. And the mingw build probably doesn't generate it.Shardik wrote:As I emphasized above you have to download the developer version which definately contains libcurl.def (my above link was to the older version 7.30.0). Here is the link to the newest developer version containing libcurl.def:
http://curl.haxx.se/gknw.net/7.32.0/dis ... ingw32.zip
- mariosk8s
- Enthusiast
- Posts: 103
- Joined: Wed Apr 06, 2011 11:37 am
- Location: Hüfingen, Germany
- Contact:
Re: curl_easy_setopt fails on 64 bit CentOS 6
Thanks @sec
This made it compile
Unfortunately the then my compiled DLL, not libcurl, won't dlopen
Of course now i'm trying to load a DLL that imports the wrapper function which links to libcurl.
Then i also dlopen libcurl.
Is there some way of debugging OpenLibrary. Currently it just reports "No", but not "Why".
This post was helpful in bringing me closer. Since i used mingw to build curl i'm using libcurldll.a.sec wrote:http://curl.haxx.se/docs/faq.html#Link_ ... ing_libcur
it is needed: libcurl_imp.lib ( download at: https://github.com/bitmovin/libdash/tre ... ibcurl/lib )
This made it compile

Unfortunately the then my compiled DLL, not libcurl, won't dlopen

Of course now i'm trying to load a DLL that imports the wrapper function which links to libcurl.
Then i also dlopen libcurl.
Is there some way of debugging OpenLibrary. Currently it just reports "No", but not "Why".
Re: curl_easy_setopt fails on 64 bit CentOS 6
Just an idea:
Is there a way to correctly call curl_easy_setopt() by using inline ASM functionality?
In other words: Is it possible to call a function of a loaded DLL from inline ASM?
Maybe this avoids the need of a wrapper and can be done by a macro using ASM?
Kukulkan
Is there a way to correctly call curl_easy_setopt() by using inline ASM functionality?
In other words: Is it possible to call a function of a loaded DLL from inline ASM?
Maybe this avoids the need of a wrapper and can be done by a macro using ASM?
Kukulkan