Member Avatar for Thew

Hi,
ahm, I'm trying to make dll that will have 5 simple functions.
For example bool GetHTTPResponse(string url, string *buffer);

So, my DLL includes curl DLL, that includes 3 anoother libraries.

I just created simple function with name GetHTTPResponse, here is the source:
{
cout << "Test" << endl;
return true;
}

I compiled it, and these files were created: request.dll, librequest.a.
So, with my previous experiences I created new project (in Dev-Cpp) with name "runner".

I included "dll.h" and in the project options, I added this library "librequest.a". Then I compiled it, and everything went ok.

But now, there is the real problem, I need to make library to use in Delphi. But when I try to compile project (still in C++) without librequest.a, I receive this message: " [Linker error] undefined reference to `_imp___Z15GetHTTPResponseSsPSs' ".

Please, can you give me some solution, how to create dll, that won't need lib***.a, because I need to use it in Delphi.
And just one question, I know how to load some simple function from Dll in Delphi, but how can I load function with arguments...

Member Avatar for Thew

But i don't need to create DLL in Delphi, but the main problem is, that I need to create DLL in C++. And there is the problem. When I try to use my C++ DLL in some C++ application I need to link it with lib***.a (my DLL is request.dll, so it's librequest.a). I know there is a way how to make DLL to don't need .a file for another application, but I don't know how can I make it.

delphi programs call win32 api functions all the time and all those functions are in DLLs written in C language. Find out how your delphi compiler links those programs and you will have your answer.

<snip>

If you use LoadLibrary() and GetProcAddress() you may not have to have the *.a library. See MSDN for details

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.