NO

Author Topic: How to disable .exp and .lib files generated by polink ?  (Read 4081 times)

modalsist

  • Guest
How to disable .exp and .lib files generated by polink ?
« 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

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: How to disable .exp and .lib files generated by polink ?
« Reply #1 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.
/Pelle

modalsist

  • Guest
Re: How to disable .exp and .lib files generated by polink ?
« Reply #2 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

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: How to disable .exp and .lib files generated by polink ?
« Reply #3 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...  :-\

/Pelle

modalsist

  • Guest
Re: How to disable .exp and .lib files generated by polink ?
« Reply #4 on: June 18, 2007, 01:57:19 PM »
Yes, is exactly this, but I can't use conditional compilation in this case.

Eduardo