Sunday, 15 August 2010

c++ - Exporting global functions from multiple projects in Windows DLL? -



c++ - Exporting global functions from multiple projects in Windows DLL? -

i have similar setup described below:

project a

windows dll depends on project b

project b

compiled static library

now, if global function, e.g. createnewfoo compiled in project b, never exported final dll, although declared dllexport , final application uses dllimport:

namespace illustration { class __declspec(dllexport) foo { foo(); }; __declspec(dllexport) foo* createnewfoo(); } }

note that, class foo exported final dll, global or static functions somehow discarded.

furthermore, note same global function exported if compiled in project a instead of project b.

is there setting in visual studio 2010 allows exporting of global or static functions dependent projects? or limitation of tools?

using static library great way reuse code. rather re-implementing same routines in every app requires functionality, write them 1 time in static library , reference apps. code linked static library becomes part of app—you don’t have install file utilize code.

as case, lib b's function linked , become part of dll a, if want export these function in dll a, should explicitly dllexport function in dll a, , in function body, can phone call lib b's function reuse code.

c++ visual-studio-2010 dllexport

No comments:

Post a Comment