GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 06-Dec-2008, 23:38
kkrizka kkrizka is offline
New Member
 
Join Date: Dec 2008
Posts: 1
kkrizka is on a distinguished road

Using Unexported Functions From A DLL


Hi all,

I'm wondering if it's possible to link against symbols in a DLL that have not been exported into a .lib file without having to rebuild the DLL.

The reason for me asking this is that I want to use some helper functions from an open source library that are not part of the public API. Under Linux and MacOSX, I've managed to do this by declaring the functions in a header file, not implementing them and leaving the linker to do its magic. However under Windows (with Visual Studio Express C++ 2008 ) I get a lot of "unresolved external symbol" concerning these functions.

This is my first project on Windows, so I'm not too familiar with how to deal with problem like these. I searched a bit about how to deal with linking problems with DLL's and I've found out that to use a function, it needs to be exported into a .lib file, which in this case it isn't. So that bring me to my original question; would it be possible to link against those functions in some weird hacky way, even though they are not exported?

Something tells me that the answer is no, so my backup solution is to copy the source code for the definition of the helper functions and include it with my application.

Thank You,
Karol Krizka
  #2  
Old 08-Dec-2008, 14:47
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 1,032
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough

Re: Using Unexported Functions From A DLL


What you want is explicit linking.

But if you have the source for the library, do you have a good reason not to rebuild the dll? Implicit linking is easier to use.

Best regards,
Lucian
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with some functions baka_yaro C++ Forum 3 14-Mar-2007 06:56
[Include] Doubly-linked List dsmith C Programming Language 6 14-Apr-2006 14:12
Functions and Classes - Where did I go wrong? redmage C++ Forum 5 10-Apr-2005 19:31
conflict between printf and stdarg.h va functions mirizar C Programming Language 3 12-Jul-2004 09:11
Understanding functions tommy69 C Programming Language 15 15-Mar-2004 18:59

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 02:33.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.