Solved C2632: 'int' can not be followed by 'bool'
-
@KroMignon thx for your answer but i don't understand what do you mean sorry,
do i have to define that ?
as i said there istypedef int BOOL;
in minwindef.h
in my project code i don't have #define BOOL bool -
@LeLev As I have written previously, somewhere in all headers you are including, I am pretty sure there is a define
#define BOOL bool
.
I guess it is in the Backhoff ADS library headers. -
ok thank you i found it, but i'm not sure what should i do with it
-
@LeLev To explain a bit more: if there is a "#define BOOL bool" somewhere and you write "typedef int BOOL;" the precompiler will extend it to
typedef int bool;
which exactly what the error message says :-)
Why do you want to define BOOL? There is already bool in C++.
-
@jsulm thank you very much for the explanation
i don't write any of these lines, i include headers of ads libraries
it's TwinCat ADS lib
the define is in this file
"TcAdsAPI.h" -
@jsulm said in C2632: 'int' can not be followed by 'bool':
Why do you want to define BOOL? There is already bool in C++.
@LeLev I don't want you to add this define, I only say there is already somewhere this define and that is why you cannot build.
So you have definition clash in your program:
- MSVC2003 want to define
BOOL
asint
- ADS library want to define
BOOL
asbool
.
By the way, this is not a Qt issue, this is an issue between this library and your compiler.
So perhaps you have to contact you library reseller?Is this more clear to you?
- MSVC2003 want to define
-
@KroMignon said in C2632: 'int' can not be followed by 'bool':
I don't want you to add this define
Not sure what you mean? I did not say this define should be added. Or did you want to write this to @LeLev ?
-
@KroMignon yes it is thank you i appreciate
-
@jsulm Sorry my failure, message was for @LeLev!
-
@KroMignon said in C2632: 'int' can not be followed by 'bool':
this is an issue between this library and your compiler.
yes it is, this was compiling about 1 year ago, but i don't remember what exact MSVC version i was using..
-
@LeLev said in C2632: 'int' can not be followed by 'bool':
yes it is, this was compiling about 1 year ago, but i don't remember what exact MSVC version i was using..
I would suggest you to modify your code to isolate ADS library usage in a C++ class which do not needs to include
minwindef.h
.
So you can get around this issue. -
i found the original topic :)
https://forum.qt.io/topic/105541/including-3rd-party-lib/2