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,955 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,840 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: 401 | Replies: 6
Join Date: May 2008
Posts: 4
Reputation: gil_mo is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gil_mo gil_mo is offline Offline
Newbie Poster

importance of dllexport location in program

  #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.
AddThis Social Bookmark Button
Reply With Quote  

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

Other Threads in the C++ Forum

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