Recent

Author Topic: [Solved] [VLC] How change path to a external dll ?  (Read 3999 times)

WimVan

  • Jr. Member
  • **
  • Posts: 85
[Solved] [VLC] How change path to a external dll ?
« on: December 28, 2018, 10:54:42 am »
After installing Lazarus 1.8.4
I can find a nice example of how creating  an application using VLC to play video ...
However,
At runtime when I want to open the video, read, play the video I got a warning the the dll  can't be found

style: C:\program files\VIDEOLAN\VLC\xxxx.dll

can't be loaded.

When installing VLC (32bit) on the PC, it is always installed in c\program files (x86)\VIDEOLAN\VLC .... and we have no choice to put it elsewhere
To have a work around I copy only the concerned dll  to c:\program files\VIDEOLAN\VLC
and so the application runs ...
My question ?  Where can I change the path so the program searches into the correct path ?

« Last Edit: December 30, 2018, 10:12:33 pm by WimVan »

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: [VLC] How change path to a external dll ?
« Reply #1 on: December 28, 2018, 11:34:13 am »
Change it in the source code that loads the library. It shouldn't be too difficult.

For a more meaningful answer you'll have to tell us which (pascal) binding to VLC you're using, etc.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

WimVan

  • Jr. Member
  • **
  • Posts: 85
Re: [VLC] How change path to a external dll ?
« Reply #2 on: December 28, 2018, 01:29:38 pm »
Sorry, but I didn't find a path at all.
I use:
Lazarus V: 1.8.4
FPC: 3.0.4
SVN: 57972

I ran the vlc-example that is delivered with that version
lazarus\components\vlc\test\testlcl.lpi

When compiled, it only runs when all needed VLC-library (dll) are set in the "program files"-folder... VIDEOLAN\VLC, but VLC installs itself under "program files (x86)"

VLC-version installed is V 3.0.4 32 bit

When checking all files on 'program files'  I found out that libvlc (in lazarus\fpc\3.0.4\source\packages\libvlc\src) has this path that can be modified and I did so.
Recompiled all (clean up and build" but no modification in the searchpath ...  Still c:\program files\videolan\vlc

I also tried the component from vlc: PasLibVlc_3.0.4, but this does not work at all.




Code: Pascal  [Select][+][-]
  1. Const
  2.  
  3. {$ifdef unix}
  4.   libname = 'libvlc.so.5';
  5. {$else}
  6. {$ifdef windows}
  7.   DefaultlibPath = 'C:\Program files (x86)\Videolan\VLC\';
  8.   corelibname    = 'libvlccore.dll';
  9.   libname        = 'libvlc.dll';
  10. {$endif}
  11. {$endif}
  12.  

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: [VLC] How change path to a external dll ?
« Reply #3 on: December 28, 2018, 02:43:22 pm »
hello,
i have no problem with vlc and paslibvlc on windows 10 64 bits  - Lazarus 1.8.2  32 bits - vlc 3.0.4 32 bits (exe in program files (x86) folder) so :
What is your lazarus version  32 bits or 64 bits ?
Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: [VLC] How change path to a external dll ?
« Reply #4 on: December 28, 2018, 03:07:08 pm »
When checking all files on 'program files'  I found out that libvlc (in lazarus\fpc\3.0.4\source\packages\libvlc\src) has this path that can be modified and I did so.
Recompiled all (clean up and build" but no modification in the searchpath ...  Still c:\program files\videolan\vlc

To make it work you'll have to recompile the libvlc . It's a FPC package so AFAICT it isn't automaticallly recompiled by Lazarus even if you do "Clean+Build".

To recompile simply open a terminal, CD to "lazarus\fpc\3.0.4\source\packages\libvlc\" and run make. That should do the trick.

Note that it would be better to find the call to Loadlibvlc() elsewhere and set your path in it. However, after looking for it I've been unable to find it and I haven't got much time now. I'm sorry I can't be of more help but this have already eaten quite a chunk of my free time and my own projects have must take precedence now. Lots of luck to you.
« Last Edit: December 28, 2018, 03:14:59 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

WimVan

  • Jr. Member
  • **
  • Posts: 85
Re: [VLC] How change path to a external dll ?
« Reply #5 on: December 30, 2018, 10:11:50 pm »
Checked and recompiled ...
Finally ...
I deinstalled VLC completely ... Cleaned up all keys in the register ...
Removed all dir and subdir Videolan created ...
Removed all info for vlc and videolan from my users-account on the PC.
Got VLC 32 bit (version 3.0.4) and reinstalled.
There I got the opportunity to change the directory where it will be installed (by default it out it in "\program files (x86)\" because it is a 32bit application.
Changed to "\program files\"  and ran the installation ...

Now, all is working without any problem.
Pitty, it would be nice if the directory where resides the needed dll is a property in the component, so we can install vlc there where we want...

 

TinyPortal © 2005-2018