Boost logo

Boost Users :

Subject: Re: [Boost-users] Issues trying to use boost::unordered_map
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2016-10-09 19:33:28


On 29/09/2016 19:40, Ram wrote:
>> Since this is C++11 code, let's go back to basics for a moment. Exactly
>> *which* version of Visual Studio are you using?
>
> I am NOT using C++11. I am using Visual Studio 2005,

As Chris indicated, the code that you quoted from the .i file earlier in
the thread is definitely C++11 code, which VS2005 cannot compile, which
in turn is probably why you're getting the errors.

Hence something you are including contains the wrong code. Either you
are including a C++11-only library somewhere, your include paths are
wrong (and eg. including CRT code from the wrong version of VS), or
you're defining preprocessor symbols that you shouldn't and hence
confusing Boost's platform detection.

On that note, what do you have in the C++/Preprocessor/Preprocessor
Definitions setting? (Click on it and go to Edit, then copy both the
top panel and the bottom Inherited Values panel.)

> I compiled just that one file(after making changes to log
> preprocessor output to file). Replaced the contents of the same file
> by the contents of the .i file and tried compiling again and I get
> lot of errors as follows. Looks like I am doing something wrong.
>
> ------ Build started: Project: Worker, Configuration: Debug Win32 ------
> Compiling...
> cl : Command line warning D9007 : '/C' requires '/E, /EP or /P'; option ignored

You need to turn the option off again after generating the .i file, just
like the option to generate the .i file in the first place.

> c:\program files (x86)\microsoft visual studio 8\vc\include\crtdefs.h(2042) : error C2011: 'localeinfo_struct' : 'struct' type redefinition
> c:\program files (x86)\microsoft visual studio 8\vc\include\crtdefs.h(2042) : see declaration of 'localeinfo_struct'

These sorts of errors suggest that you probably didn't turn off
precompiled headers. You need to do that when compiling a .i file,
since it contains all the code inline instead of including the stdafx.h
file.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net