C language > Beginner questions

How to disable .exp and .lib files generated by polink ?

(1/1)

modalsist:
I have a lib that uses export declarations and I'm not using /EXPORT command in polink, but polink is generating .exp and .lib files together with my .exe file. Can I disable them ? How ?

regards,
Eduardo

Pelle:
If the exports are not changing, you should be able to pass the .exp file (along with other .obj files) to the linker.

modalsist:
Sorry, I didn't understand.

I don't want polink create .exp and .lib files. If I link this lib (that have exported functions) the polink create .exp, .lib and .exe files, but If I don't link this lib, polink create only the exe file (what I want). There is any command that allow me to avoid polink generate .exp and .lib files ?

TIA,
Eduardo

Pelle:
I guess the code is compiled with __declspec(dllexport), which will embed one or more /EXPORT linker options in the object file(s). The linker will always process such embedded /EXPORT options - no way of turning it off. The only simple way of solving this is to (somehow) make the __declspec(dllexport) conditional when compiling... (maybe create a workspace with two different projects using the same set of source files, and two sets of compiler options - one with say /DUSEEXPORT, and then test in code with #ifdef USEEXPORT ...). All this assuming I understand your problem this time...  :-\

modalsist:
Yes, is exactly this, but I can't use conditional compilation in this case.

Eduardo

Navigation

[0] Message Index

Go to full version