View Single Post
Join Date: Aug 2005
Posts: 15,672
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1502
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: importance of dllexport location in program

 
0
  #6
May 10th, 2008
>>From what I understand from MSDN, dllexport is supposed to substitute the export section in the .DEF file -

Your understanding is incorrect. What MSDN means is that you can export the function in one of two ways:
  • use the __dllspec( __dllexport ) tags
  • add an entry into the .DEF file

The compiler does not make any entries into the .DEF file for you -- you have to do that yourself if you want them there.

Prototyping the function as you did in a.cpp is not sufficient. You have to add dllexport in the function itself
  1. a.cpp
  2.  
  3. __dllspec( __dllexport ) void a()
  4. {
  5. // blabla
  6. }

You can also export an entire c++ class
  1. __dllspec( __dllexport) class MyClass
  2. {
  3. // blabla
  4. }
Last edited by Ancient Dragon; May 10th, 2008 at 10:15 am.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote