hubaiz / DslrDashboardServer

DslrDashboard Server for OpenWrt
GNU General Public License v3.0
159 stars 60 forks source link

compile error for rpi 4 model B #32

Closed tamatoa closed 4 years ago

tamatoa commented 4 years ago

Hello, I did a fresh install on a rpi 4 modelB 2GB.

I follow all the steps and I got an error while compiling. any help to solve those errors ?

Thanks

pi@raspberrypi:~/DslrDashboardServer $ sudo g++ -Wall src/main.cpp src/communicator.cpp pkg-config --libs --cflags libusb-1.0 -lpthread -lrt -lstdc++ -o ddserver src/main.cpp: In function 'void startUdpListener()': src/main.cpp:137:21: 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:55: warning: comparison of integer expressions of different signedness: 'in_addr_t' {aka 'unsigned int'} and 'int' [-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:55: warning: comparison of integer expressions of different signedness: 'in_addr_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
  if ((groupStruct.sin_addr.s_addr = inet_addr(group)) == -1)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
src/main.cpp: In function 'void startUdpListener()':
src/main.cpp:145:12: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying 19 bytes from a string of the same length [-Wstringop-truncation]
     strncpy(buf, DD_SERVER, sizeof(DD_SERVER)-1);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/communicator.cpp:454:3: warning: "/*" within comment [-Wcomment]
   /*

In file included from src/communicator.cpp:8:
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(nullptr), //mIsInitialized(false), mIsUsbInitialized(false),
 ^~~~~~~~~~~~
src/communicator.cpp:16:27: warning: 'void libusb_set_debug(libusb_context*, int)' is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations]
   libusb_set_debug(mCtx, 0); //set verbosity level to 3, as suggested in the documentation
                           ^
In file included from src/communicator.h:12,
                 from src/communicator.cpp:8:
/usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
 void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
                  ^~~~~~~~~~~~~~~~
src/communicator.cpp:16:27: warning: 'void libusb_set_debug(libusb_context*, int)' is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations]
   libusb_set_debug(mCtx, 0); //set verbosity level to 3, as suggested in the documentation
                           ^
In file included from src/communicator.h:12,
                 from src/communicator.cpp:8:
/usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
 void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
                  ^~~~~~~~~~~~~~~~
src/communicator.cpp: In member function 'bool Communicator::readFromClient()':
src/communicator.cpp:110:9: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'int'} and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
   if (r == (packetSize - 4)) {
       ~~^~~~~~~~~~~~~~~~~~~
src/communicator.cpp:114:20: 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:19: 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 'bool Communicator::processUsbPacket(uint8_t*, int)':
src/communicator.cpp:279:16: warning: comparison of integer expressions of different signedness: 'int' and '__uint32_t' {aka 'unsigned int'} [-Wsign-compare]
     if (writen != le32toh(header->packet_len))
                ^
src/communicator.cpp: In member function 'uint8_t* Communicator::readUsbPacket(int&, bool)':
src/communicator.cpp:350:38: warning: comparison of integer expressions of different signedness: 'int' and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
  while(packetSize1 == 0 || totalRead < packetSize1) {
                            ~~~~~~~~~~^~~~~~~~~~~~~
src/communicator.cpp:364:33: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
                 if (packetSize1 > currentPacketSize - 4) {
                     ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
src/communicator.cpp:380:35: warning: comparison of integer expressions of different signedness: 'int' and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
             if (currentPacketSize < 4 + packetSize1 + 128) {
                 ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
src/communicator.cpp:387:49: warning: comparison of integer expressions of different signedness: 'int' and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
             while(packetSize2 == 0 || totalRead < packetSize2) {
                                       ~~~~~~~~~~^~~~~~~~~~~~~
src/communicator.cpp:345:27: warning: unused variable 'resume' [-Wunused-variable]
  bool isResponse = false, resume = true;
                           ^~~~~~
src/communicator.cpp: In member function 'void Communicator::sendUsbDeviceList(uint32_t)':
src/communicator.cpp:847:20: 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());
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~
hubaiz commented 4 years ago

Those are only warnings.