I am creating a GUI to control hardware with Qt Creator on Ubuntu 14.04. I have a class to control a camera (camera.h
) and a class to control a light source that is connected to a USB RS232 serial converter (light.h
). The two header files of this classes include headers provided by the manufacturer: uEye.h
and ftdi2xx.h
for the camera and the serial converter, respectively. Both libraries work perfectly if I use them separately. However when I try to include them in to my mainwindow.h
I get following error messages (its around 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;
and so on. What I understood from other posts, there seems to be no easy fix in C++. Any suggestions how to solve that (except using different hardware or having two separate programs)?
Update:
Finally I found a workaround, although it's still not the exact answer to my question. I did following: I went to the ftdi2xx.h
file and commented the trouble causing #include WinTypes.h
out. In light.h
I included uEye.h
first (I guess also this header includes some kind of WinTypes.h
). Then I needed to add some missing typedef
declarations that were not covert byuEye.h
before including ftdi2xx.h
. It works, however it is not a very clean and nice solution because it involves messing around with 3rd party stuff.