bonjour,
je dois tester libgphoto2 pour un avant projet manipulant un appareil photo numérique.
Je fais tourner mint-17.1 sous VirtualBox et j'ai installé gphoto2. Je n'ai pas encore d'appareil "compatible" gphoto2 mais l'install
à l'air de s'être bien passée. Certaines commandes répondent sans planter notamment gphoto2 --debug
qui me répond :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
d@rd-VirtualBox:~/projetSnir/cube_vues > gphoto2 --debug
0.000180 main(2): Veuillez toujours intégrer les lignes suivantes lors de l'envoi de messages de débogage à la liste de diffusion*:
0.000214 main(2): gphoto2 2.5.3
0.000225 main(2): gphoto2 a été compilé avec les options suivantes*:
0.000232 main(2):  + gcc (C compiler used)
0.000237 main(2):  + popt (mandatory, for handling command-line parameters)
0.000243 main(2):  + exif (for displaying EXIF information)
0.000248 main(2):  + cdk (for accessing configuration options)
0.000253 main(2):  + aa (for displaying live previews)
0.000258 main(2):  + jpeg (for displaying live previews in JPEG format)
0.000263 main(2):  + readline (for easy navigation in the shell)
0.000272 main(2): libgphoto2 2.5.8
0.000278 main(2): libgphoto2 a été compilé avec les options suivantes*:
0.000284 main(2):  + all camlibs
0.000289 main(2):  + gcc (C compiler used)
0.000294 main(2):  + ltdl (for portable loading of camlibs)
0.000299 main(2):  + EXIF (for special handling of EXIF files)
0.000305 main(2): libgphoto2_port 0.10.0
0.000311 main(2): libgphoto2_port a été compilé avec les options suivantes*:
0.000316 main(2):  + gcc (C compiler used)
0.000321 main(2):  + ltdl (for portable loading of camlibs)
0.000326 main(2):  + USB (libusb1, for USB cameras)
0.000331 main(2):  + serial (for serial cameras)
0.000336 main(2):  + no resmgr (serial port access and locking)
0.000341 main(2):  + no ttylock (serial port locking)
0.000347 main(2):  + no lockdev (serial port locking)
0.000353 main(2): CAMLIBS env var not set, using compile-time default instead
0.000359 main(2): IOLIBS env var not set, using compile-time default instead
0.000379 load_settings(2): Creating gphoto config directory ('/home/rd/.gphoto')
0.000417 load_settings(2): Loading settings from file '/home/rd/.gphoto/settings'.
0.000490 gp_camera_free(2): Freeing camera...
0.000502 gphoto2-port(2): Freeing port...
0.000512 gp_filesystem_reset(2): resetting filesystem
0.000518 gp_filesystem_lru_clear(2): Clearing fscache LRU list...
0.000524 gp_filesystem_lru_clear(2): fscache LRU list already empty
0.000529 delete_all_folders(2): Internally deleting all folders from '/'...
0.000536 lookup_folder(2): Lookup folder '/'...
0.000541 lookup_folder(2): Found! / is 0x8e42b30
0.000547 recurse_delete_folder(2): Recurse delete folder 0x8e42b30//
gphoto2 nécessite libgphoto2. Toute la libgphoto2 est installée sous /usr/local :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
rd@rd-VirtualBox:~/projetSnir/cube_vues/gphoto2-2.5.8 > ls -l /usr/local/lib
total 540
drwxr-xr-x 3 root root    4096 oct.  26 19:18 libgphoto2
-rwxr-xr-x 1 root root    1020 oct.  26 19:18 libgphoto2.la
drwxr-xr-x 3 root root    4096 oct.  25 13:05 libgphoto2_port
-rwxr-xr-x 1 root root    1009 oct.  26 19:18 libgphoto2_port.la
lrwxrwxrwx 1 root root      25 oct.  26 19:18 libgphoto2_port.so -> libgphoto2_port.so.12.0.0
lrwxrwxrwx 1 root root      25 oct.  26 19:18 libgphoto2_port.so.12 -> libgphoto2_port.so.12.0.0
-rwxr-xr-x 1 root root  102301 oct.  26 19:18 libgphoto2_port.so.12.0.0
lrwxrwxrwx 1 root root      19 oct.  26 19:18 libgphoto2.so -> libgphoto2.so.6.0.0
lrwxrwxrwx 1 root root      19 oct.  26 19:18 libgphoto2.so.6 -> libgphoto2.so.6.0.0
-rwxr-xr-x 1 root root  413112 oct.  26 19:18 libgphoto2.so.6.0.0
Je n'arrive pas à compiler/linker correctement un bout de code exemple du genre

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
#include <gphoto2/gphoto2.h>
#include <gphoto2/gphoto2-port.h>
 
int main()
{
  GPPort *port;
  int status;
 
  status = gp_port_new(&port);
 
  return 0;
}
je fais gcc -Wall main.c -L/usr/local/lib/xxxxx j'ai un peu tout essayé à la place du xxxx mais rien
ne marche

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
./tmp/ccSuEQ8C.o: dans la fonction « main »:
main.c:(.text+0x11): référence indéfinie vers « gp_port_new »
collect2: error: ld returned 1 exit status
Que faut-il spécifier exactement?

Merci