CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2010
    Posts
    45

    Angry VC++ using boost

    Hi,

    I'm not sure this is where to ask this question, but here goes.

    I'm using visual C++ 2010 express edition and am trying to incorporate boost. In particular, I'm trying to use trim.hpp but I keep getting the following linker error:

    MSVCMRT.lib(locale0_implib.obj) : error LNK2022: metadata operation failed (8013118D) : Inconsistent layout information in duplicated types (std._String_const_iterator<char,std::char_traits<char>,std::allocator<char> >): (0x02000019).


    Boost was installed using the BoostPro 1.43 installer (because the 1.44 kept bombing).

    My project settings are currently:

    1.) Common language Runtime Support = "Common language Runtime Support (/clr)"
    2.) Use of MFC = "Use Standard Windows Libraries"
    3.) Use of ATL = "Not Using ATL"
    4.) Runtime Libary = "Multi-threaded DLL (/MD)"
    5.) Precompiled Headers = "Not Using Precompiled Headers"



    I think maybe the project settings are to blame but I've tried every combination that I can think of and have tried the suggestions that I've seen on line, but none work. I've included the boost library in the vc++ include path, so I know the compiler is finding the needed boost files.

    Does anyone know how to fix this?

    Thanks in advance!

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: VC++ using boost

    No Boost install is really required in order to use trip.hpp as that (from the Boost string algorithms library I presume) is a header-only library. All you have to do is put Boost in the include path to use it.

    Given your use of CLR (do you really need that? You usually don't unless you're targeting .NET), I'm suspicious of the associated paragraph here:
    http://msdn.microsoft.com/en-us/libr...VS.100%29.aspx

  3. #3
    Join Date
    Jan 2010
    Posts
    45

    Re: VC++ using boost

    Thanks for replying Lindley,

    Prior to using the installer program, I did simply copy the .hpp files to the include folder but had the exact same linker error.

    I tried turning off clr, but I get many many errors:

    error C2871: 'System' : a namespace with this name does not exist
    error C2653: 'System' : is not a class or namespace name
    error C2871: 'Reflection' : a namespace with this name does not exist
    error C2653: 'System' : is not a class or namespace name
    error C2871: 'CompilerServices' : a namespace with this name does not exist
    error C2653: 'System' : is not a class or namespace name
    error C2871: 'InteropServices' : a namespace with this name does not exist
    error C2653: 'System' : is not a class or namespace name
    error C2871: 'Permissions' : a namespace with this name does not exist
    error C2337: 'AssemblyTitleAttribute' : attribute not found
    error C2337: 'AssemblyDescriptionAttribute' : attribute not found
    error C2337: 'AssemblyConfigurationAttribute' : attribute not found
    error C2337: 'AssemblyCompanyAttribute' : attribute not found
    error C2337: 'AssemblyProductAttribute' : attribute not found
    error C2337: 'AssemblyCopyrightAttribute' : attribute not found
    error C2337: 'AssemblyTrademarkAttribute' : attribute not found
    error C2337: 'AssemblyCultureAttribute' : attribute not found
    error C2337: 'AssemblyVersionAttribute' : attribute not found
    error C2337: 'ComVisible' : attribute not found
    error C2337: 'CLSCompliantAttribute' : attribute not found
    error C2337: 'SecurityPermission' : attribute not found
    error C2653: 'SecurityAction' : is not a class or namespace name
    error C2065: 'RequestMinimum' : undeclared identifier

  4. #4
    Join Date
    Jan 2010
    Posts
    45

    Smile Re: VC++ using boost

    Hi Lindley,

    I finally got it. I had to start a new project and keep all the default project settings and it worked!

    Thanks.

  5. #5
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: VC++ using boost

    It looks like you may have accidentally created a Managed C++ project rather than a native C++ project.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured