masroore / CurlSharp

CurlSharp - .Net binding and object-oriented wrapper for libcurl.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trying samples - missing libcurl64.dll

uhaile opened this issue · comments

Projects compiled ok. When running, for example, upload.exe, get the following message:

System.DllNotFoundException: Unable to load DLL 'libcurl64.dll': The specified module could not be found.

Need to be able to upload a file from a local machine to a location on a server, so ftp upload seems to be the obvious. Need to do it in C#, as part of a larger program.

Thanks very much for any help.

+1 on that issue

You need to manually copy the DLLs in the /lib folder. Rename the libcurl.dll to libcurl64.dll.
You may use latest Windows binaries from here

Hello Masroor,

Thanks for your reply about the problem in the subject line.

Sorry that I have to ask again, but I have tried your suggestion and still get a problem.

I am running windows 10, 64 bit. In my path I set f:\CurlSharp-master\libs\i386. All the installation is from the directory f:\CurlSharp

Test 1

After doing what you suggested, the upload.exe (sample that I am testing) does not complain about missing libcurl64.dll

(rename the libcurl.dll files in the f:\ CurlSharp-master\libs\i386\ to libcurl64.dll) but then I get the following error message:

System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

at CurlSharp.NativeMethods.curl_global_init(Int32 flags)

at CurlSharp.Curl.GlobalInit(CurlInitFlag flags) in F:\ CurlSharp-master\CurlSharp\Curl.cs:line 75

at Upload.Upload.Main(String[] args) in F:\ CurlSharp-master\Samples\Upload\Upload.cs:line 17

line 17 in Upload.cs is:

Curl.GlobalInit(CurlInitFlag.All);

Line 75 in Curl.cs is:

_initCode = NativeMethods.curl_global_init((int)flags);

Test 2

When I change in Visual Studio 2015 the CurlSharp project options Build, the Conditional compilation symbols, from: WIN64,USE_LIBCURLSHIM by removing WIN64 (so as not to have 64 bit required), and renaming the dlls in the libs directory to libcurl.dll, I still get the same error as above.

Further question

In the Samples directory you have an IMPORTANT NOTE. Which is the bin directory? All directories contain CurlSharp.dll.

f:\ CurlSharp-master\Samples\bin\

f:\ CurlSharp-master\CurlSharp\bin\

f:\ CurlSharp-master\CurlSharp\Samples\bin\

In addition to these locations, in each sub-directory in the Samples directory there is a bin directory, such as in:

f:\ CurlSharp-master\Samples\Upload\bin\

Under the bin directory in each case, is a Debug directory (according to the configuration when running the compiler).

Would it be possible to put the executable and the necessary libraries together in one directory, and just run it from there?

I would like to write a program in C# that uses curl and run it on various machines, which will not have Visual Studio installed, for example from an external drive. For this reason, I think I need to include the libraries in the directory where I copy my program. In addition to this, some of the machines are 32 bit and some are 64 bit. How can I do this?

Thanks very much for your help. I think it is almost working, but there is something that I am doing wrong and I can not find what it is…

Best regards,

Eli

From: Masroor Ehsan Choudhury [mailto:notifications@github.com]
Sent: Friday, November 18, 2016 6:35 AM
To: masroore/CurlSharp
Cc: uhaile; Author
Subject: Re: [masroore/CurlSharp] Trying samples - missing libcurl64.dll (#28)

You need to manually copy the DLLs in the /lib folder. Rename the libcurl.dll to libcurl64.dll.
You may use latest Windows binaries from here https://curl.haxx.se/download.html


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #28 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AWbvdXU0h_839NP1loU-ltQUqfd4fMCqks5q_UcHgaJpZM4K1N7W . https://github.com/notifications/beacon/AWbvdb7UIuqZU1QRV0NnYYWW4255x5Vzks5q_UcHgaJpZM4K1N7W.gif

I have the same problem. Did you find any solution @uhaile ??

I think it worked with the suggestion given above.
But, not using it anymore, almost a year.