View Single Post
Join Date: May 2008
Posts: 8
Reputation: gil_mo is an unknown quantity at this point 
Solved Threads: 0
gil_mo gil_mo is offline Offline
Newbie Poster

importance of dllexport location in program

 
0
  #1
May 9th, 2008
Hi,
(using MS VS2005) Recently I've found that in order for a function to be exported, dllexport *must* be placed in the same file of the function body. E.g. see the following case:

File a.cpp

  1. void dllexport a();
  2.  
  3. a();

File b.cpp

  1. void a()
  2. {
  3. // function body
  4. }

Now, a.cpp and b.cpp compile perfectly into a dll. However a() is not exported.
From what I understand from MSDN, dllexport is supposed to substitute the export section in the .DEF file - seems that it doesn't. Is this an MS bug?

Thanks,
Gil.
Reply With Quote