Recent

Author Topic: using setupapi.dll without libimp*.a file  (Read 4399 times)

josip

  • New Member
  • *
  • Posts: 19
using setupapi.dll without libimp*.a file
« on: November 02, 2016, 09:04:54 am »
Program in FPC is executed from cmd prompt on Win. Some functions from setupapi.dll are used. In source code there are defined like this...

Code: Pascal  [Select][+][-]
  1. function SetupDiGetClassDevsA(ClassGuid: PGUID; const Enumerator: PAnsiChar;
  2.   hwndParent: HWND; Flags: DWORD): HDEVINFO; stdcall; external 'setupapi.dll';
  3.  
  4. function SetupDiEnumDeviceInfo(DeviceInfoSet: HDEVINFO; MemberIndex: DWORD;
  5.   var DeviceInfoData: TSPDevInfoData): LongBool; stdcall; external 'setupapi.dll';
  6.  
  7. ...

Everything is working fine, but using dll functions generate libimp*.a file, that I don't want to have in program directory. Is there are any way to use or release dll without generating / leaving libimp*.a file.

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: using setupapi.dll without libimp*.a file
« Reply #1 on: November 02, 2016, 10:07:19 am »
Are you using Lazarus to develop your app? Check out in Project->Project Options...->Compiler Options->Paths that Unit output directory have different value than Target file name text field have.

josip

  • New Member
  • *
  • Posts: 19
Re: using setupapi.dll without libimp*.a file
« Reply #2 on: November 02, 2016, 01:07:37 pm »
No Lazarus, just FPC. After program is compiled, every time when exe is started, libimp*.a file is generated (if it is erased before).

Thaddy

  • Hero Member
  • *****
  • Posts: 14372
  • Sensorship about opinions does not belong here.
Re: using setupapi.dll without libimp*.a file
« Reply #3 on: November 02, 2016, 01:32:59 pm »
No Lazarus, just FPC. After program is compiled, every time when exe is started, libimp*.a file is generated (if it is erased before).

???? That would be a - hidden? - feature.
I don't think that is what you mean to tell us.  O:-)
After compilation and linking your project the dependecies are resolved in the binary, the libimp for that executable is linked in and will never regenerate itself when you start that executable. :D.
« Last Edit: November 02, 2016, 01:34:42 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: using setupapi.dll without libimp*.a file
« Reply #4 on: November 02, 2016, 02:35:21 pm »
Thaddy is right.

I think you somehow trigger recompilation when starting the exe and that that regeneration triggers the .a generation.


josip

  • New Member
  • *
  • Posts: 19
Re: using setupapi.dll without libimp*.a file
« Reply #5 on: November 03, 2016, 02:51:20 pm »
Thank you very much for clarification. I was wrong. libimp*.a and dummy.$$$ are generated during compiling, and not by executing generated exe file. Problem solved.

 

TinyPortal © 2005-2018