Trying to compile DDServer on Raspberry w/ OpenWRT

qDslrDashbord error reports
Post Reply
rataweb
Posts: 4
Joined: 25 Nov 2015, 06:52

Trying to compile DDServer on Raspberry w/ OpenWRT

Post by rataweb »

Hi,

I tryed to compile DDServer on a Raspberry Pi with OpenWRT, but OpenWRT not has g++, and I've tryed to compile with gcc.

Another problem that I've had, that cominicator.cpp doesn't found libusb.h library. I solved uncompressing libusb-1.0.19-rc1.tar.gz, but when I try to compile, I've some errors.

Code: Select all

root@OpenWrt:~/packages/DslrDashboardServer# gcc -Wall src/main.cpp src/communicator.cpp -I/root/pac
kages/DslrDashboardServer/libusb-1.0.19-rc1/ -lusb-1.0 -lpthread -lrt -lstdc++ -o ddserver
src/main.cpp: In function 'void startUdpListener()':
src/main.cpp:137:39: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t {aka int}' [-Wformat=]
    syslog(LOG_INFO, "recv: %ld", bytes);
                                       ^
src/main.cpp: In function 'void joinGroup(int, char*)':
src/main.cpp:280:59: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if ((groupStruct.sin_addr.s_addr = inet_addr(group)) == -1)
                                                           ^
src/main.cpp: In function 'void leaveGroup(int, char*)':
src/main.cpp:302:59: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if ((groupStruct.sin_addr.s_addr = inet_addr(group)) == -1)
                                                           ^
In file included from src/communicator.cpp:8:0:
src/communicator.h: In constructor 'Communicator::Communicator()':
src/communicator.h:64:24: warning: 'Communicator::mHandle' will be initialized after [-Wreorder]
  libusb_device_handle *mHandle;
                        ^
src/communicator.h:63:17: warning:   'libusb_device* Communicator::mDevice' [-Wreorder]
  libusb_device *mDevice;
                 ^
src/communicator.cpp:10:1: warning:   when initialized here [-Wreorder]
 Communicator::Communicator() : mSocket(0), mCtx(NULL), //mIsInitialized(false), mIsUsbInitialized(false),
 ^
src/communicator.cpp: In member function 'bool Communicator::readFromClient()':
src/communicator.cpp:110:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (r == (packetSize - 4)) {
                           ^
src/communicator.cpp:114:51: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t {aka int}' [-Wformat=]
    syslog(LOG_ERR, "Error reading packet : %ld", r);
                                                   ^
src/communicator.cpp:119:60: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'ssize_t {aka int}' [-Wformat=]
   syslog(LOG_ERR, "Error reading total packet size: %ld", r);
                                                            ^
src/communicator.cpp: In member function 'void Communicator::sendUsbDeviceList(uint32_t)':
src/communicator.cpp:662:74: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'std::vector<ImagingUsbDevice>::size_type {aka unsigned int}' [-Wformat=]
   syslog(LOG_INFO, "Imaging USB devices found: %lu", imgUsbDevices.size());
                                                                          ^
/tmp/ccqODcle.o: In function `Communicator::Communicator()':
communicator.cpp:(.text+0x7c): undefined reference to `libusb_init'
communicator.cpp:(.text+0xa4): undefined reference to `libusb_set_debug'
/tmp/ccqODcle.o: In function `Communicator::~Communicator()':
communicator.cpp:(.text+0x138): undefined reference to `libusb_exit'
/tmp/ccqODcle.o: In function `Communicator::processUsbPacket(unsigned char*, int)':
communicator.cpp:(.text+0xad0): undefined reference to `libusb_bulk_transfer'
communicator.cpp:(.text+0xb60): undefined reference to `libusb_bulk_transfer'
/tmp/ccqODcle.o: In function `Communicator::readPtpPacket(unsigned char*, int, int&)':
communicator.cpp:(.text+0x1040): undefined reference to `libusb_bulk_transfer'
/tmp/ccqODcle.o: In function `Communicator::openUsbDevice(unsigned short, unsigned short)':
communicator.cpp:(.text+0x116c): undefined reference to `libusb_get_device_list'
communicator.cpp:(.text+0x11c0): undefined reference to `libusb_get_device_descriptor'
communicator.cpp:(.text+0x12ac): undefined reference to `libusb_free_device_list'
/tmp/ccqODcle.o: In function `Communicator::initUsbDevice(libusb_device*)':
communicator.cpp:(.text+0x131c): undefined reference to `libusb_open'
communicator.cpp:(.text+0x1364): undefined reference to `libusb_get_device_descriptor'
communicator.cpp:(.text+0x1394): undefined reference to `libusb_get_config_descriptor'
communicator.cpp:(.text+0x15a8): undefined reference to `libusb_free_config_descriptor'
/tmp/ccqODcle.o: In function `Communicator::claimInterface(unsigned char, unsigned char, int)':
communicator.cpp:(.text+0x1670): undefined reference to `libusb_kernel_driver_active'
communicator.cpp:(.text+0x16ac): undefined reference to `libusb_detach_kernel_driver'
communicator.cpp:(.text+0x1700): undefined reference to `libusb_claim_interface'
/tmp/ccqODcle.o: In function `Communicator::canOpenUsbImagingDevice(libusb_device*, libusb_device_descriptor*)':
communicator.cpp:(.text+0x17ec): undefined reference to `libusb_get_config_descriptor'
communicator.cpp:(.text+0x18e4): undefined reference to `libusb_open'
communicator.cpp:(.text+0x191c): undefined reference to `libusb_kernel_driver_active'
communicator.cpp:(.text+0x1948): undefined reference to `libusb_claim_interface'
communicator.cpp:(.text+0x1974): undefined reference to `libusb_release_interface'
communicator.cpp:(.text+0x1980): undefined reference to `libusb_close'
communicator.cpp:(.text+0x19e4): undefined reference to `libusb_free_config_descriptor'
/tmp/ccqODcle.o: In function `Communicator::closeUsbDevice()':
communicator.cpp:(.text+0x1a68): undefined reference to `libusb_release_interface'
communicator.cpp:(.text+0x1ac4): undefined reference to `libusb_close'
/tmp/ccqODcle.o: In function `Communicator::sendUsbDeviceList(unsigned int)':
communicator.cpp:(.text+0x1b34): undefined reference to `libusb_get_device_list'
communicator.cpp:(.text+0x1c18): undefined reference to `libusb_free_device_list'
/tmp/ccqODcle.o: In function `Communicator::isUsbImagingDevice(libusb_device*, ImagingUsbDevice*)':
communicator.cpp:(.text+0x2028): undefined reference to `libusb_get_device_descriptor'
communicator.cpp:(.text+0x2094): undefined reference to `libusb_get_config_descriptor'
communicator.cpp:(.text+0x218c): undefined reference to `libusb_open'
communicator.cpp:(.text+0x21c4): undefined reference to `libusb_kernel_driver_active'
communicator.cpp:(.text+0x21f0): undefined reference to `libusb_claim_interface'
communicator.cpp:(.text+0x2270): undefined reference to `libusb_get_string_descriptor_ascii'
communicator.cpp:(.text+0x22b8): undefined reference to `libusb_get_string_descriptor_ascii'
communicator.cpp:(.text+0x22ec): undefined reference to `libusb_release_interface'
communicator.cpp:(.text+0x22f8): undefined reference to `libusb_close'
communicator.cpp:(.text+0x2388): undefined reference to `libusb_free_config_descriptor'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `sqrt'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `floor'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `ceil'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `cosh'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libpthread.so.0: undefined reference to `dlsym'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `tan'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `tanh'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `asin'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `log'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `atan'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `sinh'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `modf'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `ldexp'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `fmod'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `acos'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `exp'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `sin'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `pow'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `atan2'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `cos'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `frexp'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libpthread.so.0: undefined reference to `dlopen'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libstdc++.so: undefined reference to `log10'
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libpthread.so.0: undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
root@OpenWrt:~/packages/DslrDashboardServer#
Please, Could you help me? Do you known another way to compile DDServe?

Thanks,
Post Reply