Author Topic: PtpCam compile error  (Read 4532 times)

gerk.raisen

  • Member
  • ***
  • Posts: 161
PtpCam compile error
« on: January 29, 2013, 06:10:28 PM »
Hello,

I'm trying to compile ptpcam under linux for use with a linux pc but I receive this error:


canon@testing01:~/magic-lantern/contrib/ptpcam$ make
gcc -o ptpcam myusb.c properties.c ptp.c ptpcam.c  -lusb
myusb.c:32:17: fatal error: usb.h: No such file or directory
compilation terminated.
In file included from ptp.h:27:0,
                 from properties.c:22:
libptp-endian.h:39:0: warning: "htobe16" redefined
/usr/include/endian.h:64:0: note: this is the location of the previous definition
libptp-endian.h:40:0: warning: "htobe32" redefined
/usr/include/endian.h:69:0: note: this is the location of the previous definition
libptp-endian.h:41:0: warning: "be16toh" redefined
/usr/include/endian.h:66:0: note: this is the location of the previous definition
libptp-endian.h:42:0: warning: "be32toh" redefined
/usr/include/endian.h:71:0: note: this is the location of the previous definition
In file included from ptp.h:27:0,
                 from ptp.c:23:
libptp-endian.h:39:0: warning: "htobe16" redefined
/usr/include/endian.h:64:0: note: this is the location of the previous definition
libptp-endian.h:40:0: warning: "htobe32" redefined
/usr/include/endian.h:69:0: note: this is the location of the previous definition
libptp-endian.h:41:0: warning: "be16toh" redefined
/usr/include/endian.h:66:0: note: this is the location of the previous definition
libptp-endian.h:42:0: warning: "be32toh" redefined
/usr/include/endian.h:71:0: note: this is the location of the previous definition
In file included from ptp.h:27:0,
                 from ptpcam.c:21:
libptp-endian.h:39:0: warning: "htobe16" redefined
/usr/include/endian.h:64:0: note: this is the location of the previous definition
libptp-endian.h:40:0: warning: "htobe32" redefined
/usr/include/endian.h:69:0: note: this is the location of the previous definition
libptp-endian.h:41:0: warning: "be16toh" redefined
/usr/include/endian.h:66:0: note: this is the location of the previous definition
libptp-endian.h:42:0: warning: "be32toh" redefined
/usr/include/endian.h:71:0: note: this is the location of the previous definition
ptpcam.c:36:17: fatal error: usb.h: No such file or directory
compilation terminated.
make: *** [ptpcam] Error 1


I'm missing something?  :)


wolf

  • Senior
  • ****
  • Posts: 263
Re: PtpCam compile error
« Reply #1 on: January 29, 2013, 06:24:59 PM »
You need to install  libusb-dev depending on your distribution.

gerk.raisen

  • Member
  • ***
  • Posts: 161
Re: PtpCam compile error
« Reply #2 on: January 29, 2013, 11:51:41 PM »
Solved, thank you.

Pelican

  • Contributor
  • Senior
  • *****
  • Posts: 406
Re: PtpCam compile error
« Reply #3 on: February 11, 2013, 10:37:50 PM »
Is there anybody who can compile ptpcam uder windows (cygwin)?
I can fix the missing headers, but not the rest.

Code: [Select]
$ make
gcc-3 -o ptpcam myusb.c properties.c ptp.c ptpcam.c -mno-cygwin -I"/cygdrive/d/u
til/cygwin/home/Pel/7dml/contrib/ptpcam/libusb-win32-bin-1.2.2.0/include" "/cygd
rive/d/util/cygwin/home/Pel/7dml/contrib/ptpcam/libusb-win32-bin-1.2.2.0/lib/gcc
/libusb.a" -lws2_32 -lkernel32
ptpcam.c:2449:24: sys/socket.h: No such file or directory
ptpcam.c:2450:24: netinet/in.h: No such file or directory
ptpcam.c:2451:23: arpa/inet.h: No such file or directory
ptpcam.c:2452:19: netdb.h: No such file or directory
ptpcam.c:2454:1: warning: "INVALID_SOCKET" redefined
In file included from libptp-endian.h:8,
                 from ptp.h:27,
                 from ptpcam.c:21:
/usr/i686-pc-mingw32/sys-root/mingw/include/winsock2.h:296:1: warning: this is t
he location of the previous definition
ptpcam.c: In function `gdb_loop':
ptpcam.c:2511: error: `MSG_DONTWAIT' undeclared (first use in this function)
ptpcam.c:2511: error: (Each undeclared identifier is reported only once
ptpcam.c:2511: error: for each function it appears in.)
ptpcam.c:2524: error: `EWOULDBLOCK' undeclared (first use in this function)
ptpcam.c: In function `gdb_listen':
ptpcam.c:2561: error: `gdb_wsadata' undeclared (first use in this function)
ptpcam.c: In function `chdk':
ptpcam.c:2992: warning: assignment from incompatible pointer type
ptpcam.c:3017: warning: assignment from incompatible pointer type
ptpcam.c:3027: warning: passing arg 1 of `ptp_chdk_get_memory' makes integer fro
m pointer without a cast
ptpcam.c:3027: warning: assignment from incompatible pointer type
ptpcam.c:3045: warning: assignment from incompatible pointer type
ptpcam.c:3066: warning: initialization from incompatible pointer type
Makefile:12: recipe for target `ptpcam' failed
make: *** [ptpcam] Error 1
EOS 7D Mark II, EOS 7D, EOS 5, EOS 100 + lenses (10mm to 300mm), 600EX, 550EX, YN600EX x 3
EOScard, EOS DSLR firmwares, ARMu, NiControl, etc.: http://pel.hu/down

coutts

  • Developer
  • Senior
  • *****
  • Posts: 401
Re: PtpCam compile error
« Reply #4 on: February 12, 2013, 03:55:58 PM »
Is there anybody who can compile ptpcam uder windows (cygwin)?
I can fix the missing headers, but not the rest.

Code: [Select]
$ make
gcc-3 -o ptpcam myusb.c properties.c ptp.c ptpcam.c -mno-cygwin -I"/cygdrive/d/u
til/cygwin/home/Pel/7dml/contrib/ptpcam/libusb-win32-bin-1.2.2.0/include" "/cygd
rive/d/util/cygwin/home/Pel/7dml/contrib/ptpcam/libusb-win32-bin-1.2.2.0/lib/gcc
/libusb.a" -lws2_32 -lkernel32
ptpcam.c:2449:24: sys/socket.h: No such file or directory
ptpcam.c:2450:24: netinet/in.h: No such file or directory
ptpcam.c:2451:23: arpa/inet.h: No such file or directory
ptpcam.c:2452:19: netdb.h: No such file or directory
ptpcam.c:2454:1: warning: "INVALID_SOCKET" redefined
In file included from libptp-endian.h:8,
                 from ptp.h:27,
                 from ptpcam.c:21:
/usr/i686-pc-mingw32/sys-root/mingw/include/winsock2.h:296:1: warning: this is t
he location of the previous definition
ptpcam.c: In function `gdb_loop':
ptpcam.c:2511: error: `MSG_DONTWAIT' undeclared (first use in this function)
ptpcam.c:2511: error: (Each undeclared identifier is reported only once
ptpcam.c:2511: error: for each function it appears in.)
ptpcam.c:2524: error: `EWOULDBLOCK' undeclared (first use in this function)
ptpcam.c: In function `gdb_listen':
ptpcam.c:2561: error: `gdb_wsadata' undeclared (first use in this function)
ptpcam.c: In function `chdk':
ptpcam.c:2992: warning: assignment from incompatible pointer type
ptpcam.c:3017: warning: assignment from incompatible pointer type
ptpcam.c:3027: warning: passing arg 1 of `ptp_chdk_get_memory' makes integer fro
m pointer without a cast
ptpcam.c:3027: warning: assignment from incompatible pointer type
ptpcam.c:3045: warning: assignment from incompatible pointer type
ptpcam.c:3066: warning: initialization from incompatible pointer type
Makefile:12: recipe for target `ptpcam' failed
make: *** [ptpcam] Error 1
cygwin should include socket.h, maybe it's a path issue?

Pelican

  • Contributor
  • Senior
  • *****
  • Posts: 406
Re: PtpCam compile error
« Reply #5 on: February 12, 2013, 04:44:46 PM »
cygwin should include socket.h, maybe it's a path issue?
Yes, I can fix that.
The problem is the rest (gdb_listen, gdb_wsadata, etc.)
EOS 7D Mark II, EOS 7D, EOS 5, EOS 100 + lenses (10mm to 300mm), 600EX, 550EX, YN600EX x 3
EOScard, EOS DSLR firmwares, ARMu, NiControl, etc.: http://pel.hu/down