cancel
Showing results for 
Search instead for 
Did you mean: 

USB Low-Full-High Speed Peripherals

ansvc_4119226
New Contributor

I'm trying to build the CyUSB library and GUI on Ubuntu 18.04 with libusb-1.0-0 version 2:1.0.21-2 and GCC version 7.3.0. "make" runs successfully but running install.sh gives the below errors. Has anyone built this module successfully? What version of GCC did you use and did you have to change anything in the makefile(s)?

anna@anna-ThinkPad-P52s:~/Cypress/cyusb_linux_1.0.5 $ sudo ./install.sh

Your current directory is /home/anna/Cypress/cyusb_linux_1.0.5. This is where the cyusb_suite software will be installed...

g++ -fPIC -o lib/libcyusb.o -c lib/libcyusb.cpp

g++ -shared -Wl,-soname,libcyusb.so -o lib/libcyusb.so.1 lib/libcyusb.o -l usb-1.0 -l rt

cd lib; ln -sf libcyusb.so.1 libcyusb.so

rm -f lib/libcyusb.o

rm -f moc_controlcenter.cpp

rm -f ui_controlcenter.h

rm -f controlcenter.o main.o fx2_download.o fx3_download.o streamer.o moc_controlcenter.o

rm -f *~ core *.core

/usr/lib/x86_64-linux-gnu/qt4/bin/uic controlcenter.ui -o ui_controlcenter.h

g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o controlcenter.o controlcenter.cpp

g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp

main.cpp: In function ‘void update_devlist()’:

main.cpp:133:62: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

    libusb_error(r, "Error in 'get_active_config_descriptor' ");

                                                              ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In member function ‘void ControlCenter::on_pb_setAltIf_clicked()’:

main.cpp:451:59: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

    libusb_error(r2, "Error in setting Alternate Interface");

                                                           ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp:455:49: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r1, "Error in claiming interface");

                                                 ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In member function ‘void ControlCenter::on_pb_setIFace_clicked()’:

main.cpp:472:69: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

  if ( r ) libusb_error(r, "Error in 'get_active_config_descriptor' ");

                                                                     ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In function ‘void get_config_details()’:

main.cpp:562:59: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error getting configuration descriptor");

                                                           ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In function ‘void get_device_details()’:

main.cpp:702:52: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error getting device descriptor");

                                                    ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In function ‘void set_if_aif()’:

main.cpp:798:59: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

    libusb_error(r2, "Error in setting Alternate Interface");

                                                           ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp:803:48: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r1, "Error in setting Interface");

                                                ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In member function ‘void ControlCenter::on_pb_kerneldetach_clicked()’:

main.cpp:840:59: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error in detaching kernel mode driver!");

                                                           ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In function ‘void clearhalt_in()’:

main.cpp:1468:81: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error while automatically clearing halt condition on IN pipe");

                                                                                 ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In function ‘void clearhalt_out()’:

main.cpp:1482:82: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error while automatically clearing halt condition on OUT pipe");

                                                                                  ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In member function ‘void ControlCenter::on_pb6_rcv_clicked()’:

main.cpp:1501:37: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

    libusb_error(r, "Data Read Error");

                                     ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In member function ‘void ControlCenter::pb6_send_file_selected(unsigned char*, int)’:

main.cpp:1542:41: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error in bulk write!");

                                         ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In member function ‘void ControlCenter::pb6_send_nofile_selected()’:

main.cpp:1602:73: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error in bulk write!\nPerhaps size > device buffer ?");

                                                                         ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In member function ‘void ControlCenter::on_pb6_clearhalt_out_clicked()’:

main.cpp:1628:68: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error while clearing halt condition on OUT pipe");

                                                                    ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In member function ‘void ControlCenter::on_pb6_clearhalt_in_clicked()’:

main.cpp:1646:67: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error while clearing halt condition on IN pipe");

                                                                   ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In member function ‘void ControlCenter::on_pb7_clearhalt_out_clicked()’:

main.cpp:1664:68: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error while clearing halt condition on OUT pipe");

                                                                    ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In member function ‘void ControlCenter::on_pb7_clearhalt_in_clicked()’:

main.cpp:1682:67: error: invalid conversion from ‘int’ to ‘int* (*)()’ [-fpermissive]

   libusb_error(r, "Error while clearing halt condition on IN pipe");

                                                                   ^

main.cpp:74:13: note:   initializing argument 1 of ‘void libusb_error(int* (*)(), const char*)’

static void libusb_error(int errno, const char *detailedText)

             ^~~~~~~~~~~~

main.cpp: In function ‘void in_callback(libusb_transfer*)’:

main.cpp:1863:67: error: cannot convert ‘libusb_transfer_status’ to ‘int* (*)()’ for argument ‘1’ to ‘void libusb_error(int* (*)(), const char*)’

   libusb_error(transfer->status, "Transfer not completed normally");

                                                                   ^

main.cpp: In function ‘void out_callback(libusb_transfer*)’:

main.cpp:1916:67: error: cannot convert ‘libusb_transfer_status’ to ‘int* (*)()’ for argument ‘1’ to ‘void libusb_error(int* (*)(), const char*)’

   libusb_error(transfer->status, "Transfer not completed normally");

                                                                   ^

Makefile:233: recipe for target 'main.o' failed

make: *** [main.o] Error 1

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator

Hello,

In the main.cpp file, replace all instances of the variable "errno" with a different name, say "errorno" and then compile the same. This is because the identifier "errno" is reserved and cannot be used as a normal variable in any scope of the program.

Best regards,

Srinath S

View solution in original post

2 Replies
SrinathS_16
Moderator
Moderator

Hello,

In the main.cpp file, replace all instances of the variable "errno" with a different name, say "errorno" and then compile the same. This is because the identifier "errno" is reserved and cannot be used as a normal variable in any scope of the program.

Best regards,

Srinath S

View solution in original post

ansvc_4119226
New Contributor

Thanks Srinath! That fixed it.

0 Likes