Click here to Skip to main content
15,908,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi...

I have successfully executed the following as a seprate piece of code in c++:
1. Created a dll and called the dll from a seprate application.
2. Used libcurl to hit the server and recieved response.

Now i am trying to use the same libcurl code in the dll. When I try to build this code in the dll it gives me the following error :

VB
error: `curl_socket_t' has not been declared
/usr/include/curl/curl.h:339: error: typedef `curl_socket_t' is initialized (use __typeof__ instead)
/usr/include/curl/curl.h:339: error: `curl_opensocket_callback' was not declared in this scope
/usr/include/curl/curl.h:339: error: expected `,' or `;' before '(' token
demofile.cpp:91:2: warning: no newline at end of file


I am stuck with this. Can any one help.

Thanks in advance.
Posted
Comments
pasztorpisti 13-May-13 5:48am    
There is nothing special in using libcurl from a dll. Its the same as using it from an exe. The problem is probably that your dll project compiles with different settings/environment/defines.
AsthaS 13-May-13 6:08am    
i have compiled a simple dll and used it in an application, that was done successfully. The problem occured when i introduced a method which uses LibCurl..!!
pasztorpisti 13-May-13 6:58am    
What method and where?
Richard MacCutchan 13-May-13 9:12am    
Look at the first error message. Your header file includes a type that has not been declared so you are missing that definition, which presumably should be in a prior header file.
AsthaS 14-May-13 1:50am    
This is my sample code :
#ifndef DEMO_CODE_H
#define DEMO_CODE_H


#include < stdio.h >
#include < windows.h >
#include < iostream >
#include "curl/curl.h"

extern "C" __declspec(dllexport) int GetCapabilities();
//;


There is one cpp file which includes the definition of int GetCapabilities() method.
But the error is occurring in the curl.h file which i haven't even touched.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900