tags:

views:

262

answers:

3

I'm trying to write a simple curl program to retrieve the web page in VC++ 8.0.

 #include <stdio.h>
 #include <curl.h>

 int main(void)
 {
   CURL *curl;
   CURLcode res;

   curl = curl_easy_init();
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
     res = curl_easy_perform(curl);
      /* always cleanup */
    curl_easy_cleanup(curl);
   }
   return 0;
 }

I added the include and library paths to cURL include and lib directory. It complies but when I try to enter debug mode, An unhandled non-continuable STATUS_DLL_NOT_FOUND exception was thrown during process load and code exits with -1073741515 (0xc0000135).

+1  A: 

if you run it outside of debug mode, does it work as expected? or does the same error occur?

if it doesn't work outside of debug mode, your application was not able to locate the dll.

another question, are you tring to compile libcurl from sources along with your project, or are you using it as an external library?

if you are using the sources, you might need to compile the whole solution so that libcurl is compiled as well.

if you are using the external library, try putting the dll in the working directory of your application (it wasn't able to locate it).

maranas
No, it doesn't work at all. I'm using external curllib.lib to link with project. I tried putting the curlib.dll but it still doesn't work.
Dave18
i don't think it is a problem with the linking, because you were able to compile it into an executable.just a guess... does curllib.dll have other dependencies? i think you are correctly finding curllib.dll, ut curllib.dll itself is looking for other DLLs to reference. especially if you are using the version with SSL
maranas
Yes, I think it requires other DLLs like libssl32.dll. but I also downloaded the one without SSL, It comes with only one DLL and it doesn't work for me either. do i need to specify it as delayed loaded DLLs?
Dave18
i don't think you need to specify the other DLLs for delayed loading. since you are using the binary version of libcurl, try this:- add curllib.lib to the additional import libraries (in the Linker settings of your project).- copy the curllib.dll file into the directory of your executable.if you still experience errors, or unexpected behavior, try running it outside of debug mode but use DebugViewer (from SysInternals) to view the debug output.also, make sure the working directory of your project is the same as the directory your application (and curllib.dll) is in.
maranas
I downloaded the source code and complied the DLLs/library files and then I finally got it to work.
Dave18
+1  A: 

Use dependency walker to figure out which .dll is not being loaded, then copy it somewhere on your path, or on the same folder where your program is located.

Ismael
Dependency walker reports CURLLIB.DLL wasn't found, I download this version of libcurl for MSVS http://curl.haxx.se/download/libcurl-7.19.3-win32-ssl-msvc.zip and included the header and library paths. I don't know why It cannot link to DLL.
Dave18
Just to be sure copy curllib.dll to c:\windows\system32 and test again. If still fail perhaps you have used a .dll from another version, ensure that your headers and your .dll belong to the same version.
Ismael
After putting curllib.dll to c:\windows\system32. there're two errors. IESHIMS.DLL - Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module. WER.DLL - Warning: At least one delay-load dependency module was not found.
Dave18
Did you try to run your program? Sometimes depends try too hard and find some dependecies that are not really required.
Ismael
Yes, but I still see the debugger error in output window. when i try to run the above c++ code i posted, In console, it just says "Press any key to continue..."
Dave18
A: 

SOLVED!! After reading a bunch of forums. The real solution is as described by Ismael. Thanks buddy!

ERROR: ....symbols not found.. blah blah Debugger:: An unhandled non-continuable STATUS_DLL_NOT_FOUND exception was thrown during process load The program '[3936] VTools.exe: Native' has exited with code -1073741515 (0xc0000135).

Explanation:: This happens when one of the dll's is not found by Visual Studio, which obviously is not pointed out by Visual Studio

Solution:: In my case I had cutil32.dll missing so I had to copy it to C:/Windows/system32 folder. Figuring out which dll is missing is really difficult (I hate MSFT for this). Anyways download dependency walker and File->Open the executable file (either Debug or Release). Run it and you will find out what dll's are missing. In my case these files were missing CUTIL32.DLL, MSVCR80.DLL, MSJAVA.DLL. Copying CUTIL32.dll SOLVED the problem to system32 folder. Good Luck!!

reddy