Page 1 of 1

Call of inbuild procedure overrides own import

Posted: Thu Jul 24, 2025 9:37 am
by infratec
Hi,

I needed the external libcurl.dll, because I want to use the ldap protocol.

So I set the flag before including libcurl.pbi

Code: Select all

#LibCurl_ExternalDLL = #True
XIncludeFile "../pbi/libcurl.pbi"
In my version I use a .lib file and ImportC "libcurl_External.lib"

If I use now a procedure out of the Http lib, the internal libcurl is used.

For example if I use URLEncoder() in my code and showing the version of libcurl, it results in 7.68
If I remove URLEncoder() I get 8.15 as expected.

Why ???
And how can I avoid this?

The here published version of libcurl.pbi is not affected, because the 'import' of the external dll is done via OpenLibrary().

Re: Call of inbuild procedure overrides own import

Posted: Fri Jul 25, 2025 4:49 am
by idle
what happens if you make an import lib to your dll rename the libcurl.lib in PureLibraries\windows\Libraries and add your renamed import lib there?
The compiler copies the used libs into it's temporary directory for the linking stage so maybe that would work.
I know that's not a fix but it's at least something you can test.

Re: Call of inbuild procedure overrides own import

Posted: Wed Jul 30, 2025 9:48 am
by Fred
It's not a bug, as the HTTP lib uses the libcurl lib, so it links it and the linker pick the one randomly I guess.