How To Install Gphoto2 On Windows
I have successfully compiled and built libgphoto2 and gphoto2 under Windows 10 using the excellent MSYS2 mingw64 environment. With my Nikon D5000 I started testing the basic functionalities. On 14 October 2017 at 15:14, Peter Budai.@. wrote:No standalone installer, but you can use the MSYS2 version of gphoto2 onWindows 10 64-bit.
Download and install MSYS2,and then you can install gphoto2by:pacman -S mingw-w64-x8664-gphoto2After that you can use either from bash (environment variable set bypacman automatically) or from a command prompt, assuming you set the rightenvironment variables by hand.—You are receiving this because you commented.Reply to this email directly, view it on GitHub,or mute the thread. Thank you, Peter, for the possibility to build gphoto2 and libgphoto2 for Windows.I have a couple of questions about the usage.gphoto2 works perfect from mingw64 shell. But is it possible to use it from standard cmd? The program itself is working from cmd but -auto-detect shows no camera attached (gphoto2 -auto-detect launched in migw64 terminal shows my Canon EOS 400D at the same time).As well gphoto2 -list-ports started in cmd window shows empty list (while a list of 7 connections is shown in migw64 terminal). I tried various usb drivers (libusb-win32, WinUSB, no driver) - gphoto2 launched in mingw64 terminal always sees the camera, but never sees it when launched from cmd window.
What can be done to use gphoto2 on systems without mingw/msys2 installed?Another question is about binding libgphoto2 to java. I currently develop java based GUI for time lapse capture using jna based binding to libgphoto2. It works perfect in Linux. But it seems I cannot bind it correct in Windows. The best result is reached when I put all native dll's to a.jar file on the class path. The library (lingphoto2-6.dll) is found (although after renaming it to gphoto2.dll) and probably loaded. But then unsatisfied link appears because some necessary module cannot be found.
It seems that it is some of dependencies, but I cannot understand which one.So the question is: is it possible in principle to use jna with these dll's built with mingw64, and what is the correct procedure?Stanislav. Hi, yes the version which you used under from the mingw64 shell is working from the standard cmd, but in order to make that work, you need to make sure that the shell finds the dependent libraries (and libgphoto2 has a number of those). You either add to the PATH the mingw64bin folder, or even better distribute/copy the dependent libraries with your gphoto2 installation. You can get a list of those libraries by using Dependency Walker.Also, I'd suggest to check how we are distributing libgphoto2 with darktable.With the java binding, unfortunately I cannot help, as I don't know java that much.
Thank you again. I managed to run gphoto2 from cmd line finally after specifying necessary paths to the dependencies and after setting two env variables, IOLIBS and CAMLIBS, following corresponding locations of dll's for cameras and ports.But I have found some problems with the windows port of gphoto2.
My camera (Canon EOS 400D) captures only the first image in response to -F n -I m -capture-image-and-download. The next capture in the series produces no shutter release and finishes with 'Sorry, your camera does not support generic capture'. Single image capture (no -F specified) goes without any problem. When -debug is asked the camera does no capture at all with or without -F option specified (again that 'Sorry, your camera does not support generic capture'). I have never tried that paticular setting, but it should work as the windows binaries have no specific limitations compared to other platforms.If you build a software using libgphoto on Windows bear in mind that normal default camera drivers on Windows unfortunately do not have libusb interface, therefore ligphoto cannot use cameras with those drivers. You need to install (by hand) drivers which do support libusb interface.You can read more about that here:And here is a software which makes easy to install such drivers. Hello!First off, thank you so much for porting to Windows!
I have been using gphoto2 for years but now am working on a larger application that has a Windows 10 requirement, and you guys seem to have done it but something isn't working for me, following all of the steps above. Any insight or help at all would be super appreciated!! (and apologies for also bumping a closed issue.). installed MSYS2. installed gphoto2 and libgphoto2 via pacman -S mingw-w64-x8664-gphoto2, everything seems successful. In the MINGW64 shell, I try and use gphoto2, and even with the simplest gphoto2 -version I get:C:/msys64/mingw64/bin/gphoto2.exe: error while loading shared libraries: libreadline7.dll:cannot open shared object file: No such file or directoryIn the mingw64bin folder, libreadline7.dll does exists, so it seems gphoto2 is simply looking for it elsewhere. I've tried adding C:msys64mingw64bin to the PATH env vars, but this doesn's solve the issue (does allow me to get similar results in a CMD shell so that's something).
Same results on two machines. Might something have broken with dependencies or a new version of gphoto2?
I'm totally new to MSYS2 so I could be missing something simple.Thanks a million, mate! HiNeedless to say it's working here. $ gphoto2 -versiongphoto2 2Copyright (c) 2000-2018 Lutz Mueller and othersgphoto2 comes with NO WARRANTY, to the extent permitted by law.
You mayredistribute copies of gphoto2 under the terms of the GNU General PublicLicense. For more information about these matters, see the files named COPYING.This version of gphoto2 is using the following software versions and options:gphoto2 2.5.17 x8664-w64-mingw32-gcc, popt(m), exif, no cdk, no aa, jpeg, readlinelibgphoto2 2.5.19 all camlibs, x8664-w64-mingw32-gcc, ltdl, EXIFlibgphoto2port 0.12.0 iolibs: disk ptpip usb1, x8664-w64-mingw32-gcc, ltdl, USB, no serialQuestion: after you have installed MSYS2, have you updated the MSYS2 system by opening the MSYS2 shell, and typing pacman -Syu? When I install MSYS2 into the default C:msys64, open automatically after install, and run pacman -Syu, i get this::: Proceed with installation?
Y/n y:: Retrieving packages.filesystem-2018.08-1. 43.7 KiB 42.7M/s 00:00 ########################### 100%msys2-runtime-2.11.1. 2.5 MiB 1362K/s 00:02 ########################### 100%mintty-12.9.1-1-x8664 288.3 KiB 1737K/s 00:00 ########################### 100%pacman-mirrors-201806. Now here's something - I copy/pasted libreadline7.dll into various folders to see where it was looking for the dll. Found msys wanted it in C:msys64usrbin instead of C:msys64mingw64bin.
So I got a new error, that libpopt-0.dll was missing, copied it over. Continued this process a few times, and got this (which is the same error I get if I add C:msys64mingw64bin to my user PATH env var, which makes some amount of sense): $ gphoto2 -versionC:/msys64/mingw64/bin/gphoto2.exe: error while loading shared libraries:?:cannot open shared object file: No such file or directoryDoes anything about this jump out to you that I could investigate? Not seeing any? Filenames when I search.
Again thank you immensely for your time, if you have any to spare! HeyYea, been reading the wiki up and down - anything with pacman I use the MSYS2 shell, and am trying to launch gphoto2 with MINGW64 shell. Thinking something is up with the PATH.Yes, in the MINGW64 shell, echo $MSYSTEM yeilds MINGW64, makes sense. In the same shell, echo $PATH yeilds: /mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/I see that the first entry directs it to the binaries in mingw64 where gphoto.exe and its dependencies exist. But MINGW64 cant find the packages there. For some reason, I get past the missing libreadline etc and on to the missing? Package with C:msys64mingw64bin in my user PATH, even without an env var that is MSYS2PATHTYPE as inherit.
Seems contrary to my understanding of the wiki.? Could it be conflicting with something else on my PC? That is really weird. So the PATH and the SHELL is OK.
Sorry for the delay, started a new gig and haven't been near my Windows setup. When I run ldd /mingw64/bin/gphoto2 I get different responses.
Install Gphoto2 Ubuntu
Literally running these commands 10 seconds after one another. I'm finally back able to work on this again.Really odd.