•
•
•
•
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:
Rep Power: 0
Solved Threads: 0
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
File b.cpp
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.
(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
C++ Syntax (Toggle Plain Text)
void dllexport a(); a();
File b.cpp
C++ Syntax (Toggle Plain Text)
void a() { // function body }
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.
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the C++ Forum
- Previous Thread: Help me with txt!!!
- Next Thread: End Of File (ifstream)



Threaded Mode