new user with compile problems
I am trying to use Boost version 1.36 with Microsoft Visual Studio 2005. When I try to include the thread library, I get all kinds of compile errors. One example is: Error 1 error C2632: 'float' followed by 'float' is illegal C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h 155 This does not seem right, however, I don't know what to do about it. Please help! _________________________________________________________________ Get ideas on sharing photos from people like you. Find new ways to share. http://www.windowslive.com/explore/photogallery/posts?ocid=TXT_TAGLM_WL_Phot...
Brenda Orlin wrote:
I am trying to use Boost version 1.36 with Microsoft Visual Studio 2005. When I try to include the thread library, I get all kinds of compile errors. One example is: Error 1 error C2632: 'float' followed by 'float' is illegal C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h 155
Please check whether (a) your own code or (b) third-party code that you include (not boost) does something like: #define FLOAT float In case of (a): Don't do that. In case of (b): Trash the included library. If you can't: Do something like: #undef FLOAT *before* including any windows header and boost header (because the last one can include windows headers) after inclusion of the third-party code. This can influence the behavior of the third-party tool, so you possibly need to completely separate this third-party tool header from others (own translation unit). HTH & Greetings from Bremen, Daniel Krügler
Brenda Orlin wrote:
I am trying to use Boost version 1.36 with Microsoft Visual Studio 2005. When I try to include the thread library, I get all kinds of compile errors. One example is: Error 1 error C2632: 'float' followed by 'float' is illegal C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h 155
Please check whether (a) your own code or (b) third-party code that you include (not boost) does something like: #define FLOAT float In case of (a): Don't do that. In case of (b): Trash the included library. If you can't: Do something like: #undef FLOAT *before* including any windows header and boost header (because the last one can include windows headers) after inclusion of the third-party code. This can influence the behavior of the third-party tool, so you possibly need to completely separate this third-party tool header from others (own translation unit). HTH & Greetings from Bremen, Daniel Krügler
The only code I am including that was not self-developed is standard C/C++ headers and Boost stuff. I have just confirmed that if I comment-out the line which #includes boost/thread, the code compiles fine. If I put the line back in (not even trying to use the Boost stuff, just including that header), I get all the errors again. Any other suggestions?> To: boost-users@lists.boost.org> From: dsp@bdal.de> Date: Thu, 28 Aug 2008 07:59:13 +0200> Subject: Re: [Boost-users] new user with compile problems> > Brenda Orlin wrote:> > I am trying to use Boost version 1.36 with Microsoft Visual Studio 2005. > > When I try to include the thread library, I get all kinds of compile > > errors. One example is:> > Error 1 error C2632: 'float' followed by 'float' is illegal C:\Program > > Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h 155 > > Please check whether (a) your own code or (b) third-party code that you> include (not boost) does something like:> > #define FLOAT float> > In case of (a): Don't do that.> In case of (b): Trash the included library. If you can't: Do something> like:> > #undef FLOAT> > *before* including any windows header and boost header (because the last > one can include windows headers) after inclusion of the third-party> code. This can influence the behavior of the third-party tool, so> you possibly need to completely separate this third-party tool header> from others (own translation unit).> > HTH & Greetings from Bremen,> > Daniel Krügler> > _______________________________________________> Boost-users mailing list> Boost-users@lists.boost.org> http://lists.boost.org/mailman/listinfo.cgi/boost-users _________________________________________________________________ Get thousands of games on your PC, your mobile phone, and the web with Windows®. http://clk.atdmt.com/MRT/go/108588800/direct/01/
Brenda Orlin wrote:
The only code I am including that was not self-developed is standard C/C++ headers and Boost stuff. I have just confirmed that if I comment-out the line which #includes boost/thread, the code compiles fine. If I put the line back in (not even trying to use the Boost stuff, just including that header), I get all the errors again. Any other suggestions?
Please provide a minimal example code that should demonstrate the
problem. I tested the following - which summarizes your description -
and compiled it with VS2005 SP 1 successfully:
--------------------------------
#include
To save anyone else this problem - it turns out you have to include boost headers FIRST to avoid problems!
To: boost-users@lists.boost.org> From: dsp@bdal.de> Date: Thu, 28 Aug 2008 16:51:40 +0200> Subject: Re: [Boost-users] new user with compile problems> > Brenda Orlin wrote:> > The only code I am including that was not self-developed is standard > > C/C++ headers and Boost stuff. I have just confirmed that if I > > comment-out the line which #includes boost/thread, the code compiles > > fine. If I put the line back in (not even trying to use the Boost stuff, > > just including that header), I get all the errors again. Any other > > suggestions?> > Please provide a minimal example code that should demonstrate the > problem. I tested the following - which summarizes your description -> and compiled it with VS2005 SP 1 successfully:> > --------------------------------> #include
> > int main() {> }> --------------------------------> > Greetings from Bremen,> > Daniel Krügler> > _______________________________________________> Boost-users mailing list> Boost-users@lists.boost.org> http://lists.boost.org/mailman/listinfo.cgi/boost-users
See what people are saying about Windows Live. Check out featured posts. http://www.windowslive.com/connect?ocid=TXT_TAGLM_WL_connect2_082008
[This is my third attempt to replies - hopefully it gets into the group] Brenda Orlin wrote:
I am trying to use Boost version 1.36 with Microsoft Visual Studio 2005. When I try to include the thread library, I get all kinds of compile errors. One example is: Error 1 error C2632: 'float' followed by 'float' is illegal C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h 155
This is not an error, for which boost is responsible. Either your
own code or code, which you include, contains a macro definition
similar to
#define FLOAT float
If this is your's: Don't do that. Either get rid of the corresponding
code (through it away or isolate it into a separate translation unit)
or try (but this is a dangerous thing) to
#undef FLOAT
before including any header that might include
participants (2)
-
Brenda Orlin
-
Daniel Krügler