Pelles C forum

C language => Beginner questions => Topic started by: modalsist on June 06, 2007, 03:07:46 AM

Title: How to disable .exp and .lib files generated by polink ?
Post by: modalsist on June 06, 2007, 03:07:46 AM
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
Title: Re: How to disable .exp and .lib files generated by polink ?
Post by: Pelle on June 07, 2007, 08:34:50 PM
If the exports are not changing, you should be able to pass the .exp file (along with other .obj files) to the linker.
Title: Re: How to disable .exp and .lib files generated by polink ?
Post by: modalsist on June 08, 2007, 01:40:25 PM
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
Title: Re: How to disable .exp and .lib files generated by polink ?
Post by: Pelle on June 13, 2007, 10:57:42 PM
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...  :-\

Title: Re: How to disable .exp and .lib files generated by polink ?
Post by: modalsist on June 18, 2007, 01:57:19 PM
Yes, is exactly this, but I can't use conditional compilation in this case.

Eduardo