1
votes

I have a library, written in C++ (and I have its full source). Due to its LGPL license I can only use it with the proprietary software of my company via dynamic linkage (static linkage works fine). So, I need to build it into a DLL. However, the library is quite big and doesn't export anything (hence no .def file and no __declspec(dllexport) statatements in front of the class and global function names). So, when I build a dll, it's useless, as it doesn't have exported names, so it won't link. In our company we are using MS Visual C++, which by default does not export names (while, for instance, GNU GCC, when run via MINGW on Windows does). So, the only option I see at the moment is placing __declspec(dllexport) in front of every name in the library that I'm using (and there are thousands), or writing a .def file for those names. But even if I did that, I will not be able to use the next version of the library, as I'll have to do this job again. I was looking for a tool that does these exports, or generates a .map file, but none really do this specific task (there are some DEF generators, but they mostly search the result of DUMPBIN /EXPORT which gives nothing in my case). I was searching the web for answers for two days now, but no good result.

Best regards, Andriy

2
.map file? I think VS can generate .map files.fefe
Are you certain LGPL does not allow you to link the library statically? That isn't my understanding. (For one thing, wasn't LGPL invented before dynamic linking was invented?)Harry Johnston
Fete-> Sorry for the typo, I mean to say .def file, not .map.user1128000
Harry Johnson-> You are right, LGPL is old, but LGPL 3.0 is from June 2007 :). You can check here: gnu.org/licenses/lgpl.html Among other things it says: 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.user1128000

2 Answers

1
votes

IANAL But if the library is LPGL they should be open to dynamic linking.

Have you considered modifying the source file and updating Makefile to give a way to generate the dynamic library and getting it approved by the maintainer ? Chances are they will be open to it and future versions will just work.

0
votes

I don't think that there is such a automation you want.

My suggestion is editing the source code (as you said); using Notepad++'s macros or using Replace Pioneer

Regards