I am creating a GUI for managing equipment with Qt Creator on Ubuntu 14.04. I have a class for controlling a camera ( camera.h ) and a class for controlling a light source that is connected to a USB to RS232 serial converter ( light.h ). Two header files of this class include headers provided by the manufacturer: uEye.h and ftdi2xx.h for the camera and serial converter, respectively. Both libraries work fine if I use them separately. However, when I try to include them in my mainwindow.h , I get the following error messages (about 14):
/home/g/Desktop/release/WinTypes.h:14: error: conflicting declaration 'typedef unsigned int BOOL' typedef unsigned int BOOL; /usr/include/uEye.h:1570: error: 'BOOL' has a previous declaration as 'typedef int32_t BOOL' typedef int32_t BOOL;
etc. As I understood from other posts, in C ++, there seems to be no easy solution. Any suggestions for resolving them (with the exception of using other equipment or two separate programs)?
Update:
Finally, I found a workaround, although this is still not an exact answer to my question. I did the following: I went to the ftdi2xx.h file and commented on the problem that caused #include WinTypes.h . In light.h , I first included uEye.h (I think this header also includes some WinTypes.h ). Then I needed to add some missing typedef declarations that were not hidden by uEye.h before including ftdi2xx.h . It works, however, it is not a very clean and pleasant solution, because it involves a mess with third-party things.
source share