User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 402,510 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,667 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 361 | Replies: 4
Reply
Join Date: Jan 2008
Posts: 40
Reputation: Thew is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Thew's Avatar
Thew Thew is offline Offline
Light Poster

Help DLL problem

  #1  
Jan 17th, 2008
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...
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,699
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 36
Solved Threads: 878
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: DLL problem

  #2  
Jan 17th, 2008
you might find the answer in one or more of these google links.
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Join Date: Jan 2008
Posts: 40
Reputation: Thew is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Thew's Avatar
Thew Thew is offline Offline
Light Poster

Re: DLL problem

  #3  
Jan 17th, 2008
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.
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,699
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 36
Solved Threads: 878
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: DLL problem

  #4  
Jan 17th, 2008
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>
Last edited by Ancient Dragon : Jan 17th, 2008 at 11:45 am. Reason: removed comment about moving thead to Delphi forum
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,699
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 36
Solved Threads: 878
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: DLL problem

  #5  
Jan 17th, 2008
If you use LoadLibrary() and GetProcAddress() you may not have to have the *.a library. See MSDN for details
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb C++ Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 6:08 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC