Call of inbuild procedure overrides own import

Just starting out? Need help? Post your questions and find answers here.
infratec
Always Here
Always Here
Posts: 7594
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Call of inbuild procedure overrides own import

Post 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().
User avatar
idle
Always Here
Always Here
Posts: 5854
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Call of inbuild procedure overrides own import

Post 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.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Call of inbuild procedure overrides own import

Post 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.
Post Reply