Click to See Complete Forum and Search --> : Disabling LIB file generation
Victor Boctor
August 31st, 1999, 02:02 PM
My project is an EXE, and there is __declspec(dllexport) thus after linking a lib file is generated which takes a long time. Since I do not need this LIB file, I would like to disable it. What is the linker option that I should use to achieve this.
Creating library .\Debug/myproject.lib and object .\Debug/myproject.exp
Victor Boctor
August 31st, 1999, 02:32 PM
Hi,
I found a solution and I thought I would share it with you guys. In the MSDN documentation it says that if in the project there exists an EXP file, the linker assumes that the .LIB exists and hence does not re-generate. So what I made was to create a dummy .EXP in the source code directory using the notepad and explain in it why is it there, and then add it to the project. Hence the compiler will not generate the LIB file except in case of re-build all.
Thanks,
Victor.
August 31st, 1999, 03:43 PM
Including __declspec(dllexport) in your source code causes the compiler to attempt to define symbols (functions or variable) that can be
used by others. The .lib file that is being generated tells these clients the offset into the file to find the symbols. By not generating the .lib file
nobody will be able to use the exported symbols. So if you aren't going to generate the .lib file, why are you exporting symbols.
I think the simple answer to your question is stop exporting symbols. If there are no exported symbols, the library will not be created. You
will also be able to get rid of this .exp hack.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.