is there a way to create a DLL without use __declspec dllexport at each functions ?
any1 know if there is a way to create a dll project without use __declspec dllimport/dllexport at each function ?
what i am actually need here is, convert a static lib project into a dll project. and this project contains couple hundred files.
the only way that i am aware of to make a dll is by put __declspec dllimport/dllexport infront of each function. which will take me days to complete that task.
so i'd like to ask if any1 know there is a way that i can get away with that ? maybe a macro or a way of build the project, so it will automatically grab all the functions and export them to a dll.
Re: is there a way to create a DLL without use __declspec dllexport at each functions
First of all you need to know what functions really require to be exported, and later export only those ones required to be exposed at application level.
Do you know anything about libraries? The fact that function is implemented in the library never means it is directly called by application. The same is applicable to dlls.
And no, I'm not aware of a tool that would let you automate your task.
Re: is there a way to create a DLL without use __declspec dllexport at each functions
Does the library contain classes that you would like to expose? If so, you can save some time by exporting the classes and thus providing access to all of its public methods. Otherwise, you should follow Igor's advice.
Re: is there a way to create a DLL without use __declspec dllexport at each functions
ty for the replies.
im not too sure how many classes are there in my project, but there are close to 9 thousand non-class functions need to be exported.
i am going to write a little tool to do this **** task for me. its not going to be fun if i need to open every single file and modify them.
Re: is there a way to create a DLL without use __declspec dllexport at each functions
Originally Posted by Igor Vartanov
First of all you need to know what functions really require to be exported, and later export only those ones required to be exposed at application level.
Do you know anything about libraries? The fact that function is implemented in the library never means it is directly called by application. The same is applicable to dlls.
And no, I'm not aware of a tool that would let you automate your task.
unfortunately, every single function in the project need to be exported. coz this project is kinda like a bridge project in between two programs, one is called "Action", one is called "Command", and they need something in between to link them together, and this is also why, i need to export all the functions in the project.
and also lucky, this will make save me sometime to create the customized tool to export all the functions.
Re: is there a way to create a DLL without use __declspec dllexport at each functions
Okay, maybe this information will make your tool be a bit easier: __declspec(dllexport) is not an only available way for exporting functions. Old good DEF file still remains in effect, end every single function whose name matches to the name mentioned in EXPORTS section appears exported. So, you never need to modify your library sources. In fact you need to compose a simple textual file like this:
Bookmarks