Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. cliext::list strange behavior

cliext::list strange behavior

Scheduled Pinned Locked Moved Managed C++/CLI
c++helpcsharpvisual-studiodebugging
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ian__lindsay
    wrote on last edited by
    #1

    I am trying to use a cliext::list<> and am hitting various problems - apologies, its a long one - but stick with me :) . Before I start, I am using Visual Studio 2008 with service pack 1. I am (relatively) new to mixed mode programming - my background is pure C++ / MFC, etc - so it is entirely possible I am misunderstanding something. I have reduced my first problem to the following: Header file: #pragma once #include private ref class TestClass { cliext::list ^ m_list; public: TestClass(void); }; .cpp file: #include "StdAfx.h" #include "TestClass.h" TestClass::TestClass(void) : m_list(gcnew cliext::list()) { } Produces this little lot... (project name is LNK2022) 1>------ Build started: Project: LNK2022, Configuration: Debug Win32 ------ 1>Linking... 1>TestClass.obj : error LNK2022: metadata operation failed (80131188) : Inconsistent field declarations in duplicated types (types: cliext.impl.list_impl; fields: _Myhead): (0x0400000a). 1>TestClass.obj : error LNK2022: metadata operation failed (80131188) : Inconsistent field declarations in duplicated types (types: cliext.impl.list_impl; fields: _Mysize): (0x0400000b). 1>TestClass.obj : error LNK2022: metadata operation failed (80131188) : Inconsistent field declarations in duplicated types (types: cliext.impl.list_impl; fields: _Mygen): (0x0400000c). 1>TestClass.obj : error LNK2022: metadata operation failed (801311D7) : Differing number of fields in duplicated types (cliext.impl.list_impl): (0x02000023). 1>TestClass.obj : error LNK2022: metadata operation failed (8013118B) : Inconsistent implemented interfaces in duplicated types (types: cliext.impl.list_impl; interfaces: System.Runtime.CompilerServices.CallConvStdcall): (0x09000001). 1>TestClass.obj : error LNK2022: metadata operation failed (8013118B) : Inconsistent implemented interfaces in duplicated types (types: cliext.impl.list_impl; interfaces: System.IDisposable): (0x09000002). 1>TestClass.obj : error LNK2022: metadata operation failed (8013118B) : Inconsistent implemented interfaces in duplicated types (types: cliext.impl.list_base; interfaces: System.Runtime.CompilerServices.CallConvFastcall): (0x09000003). 1>TestClass.obj : error LNK2022: metadata operation failed (8013118B) : Inconsistent implemented interfaces in duplicated types (types: cliext.impl.list_base; interfaces: System.Runtime.CompilerServices.CallConvThiscall): (0x09000004). 1>TestClass.obj : error LNK20

    G 1 Reply Last reply
    0
    • I ian__lindsay

      I am trying to use a cliext::list<> and am hitting various problems - apologies, its a long one - but stick with me :) . Before I start, I am using Visual Studio 2008 with service pack 1. I am (relatively) new to mixed mode programming - my background is pure C++ / MFC, etc - so it is entirely possible I am misunderstanding something. I have reduced my first problem to the following: Header file: #pragma once #include private ref class TestClass { cliext::list ^ m_list; public: TestClass(void); }; .cpp file: #include "StdAfx.h" #include "TestClass.h" TestClass::TestClass(void) : m_list(gcnew cliext::list()) { } Produces this little lot... (project name is LNK2022) 1>------ Build started: Project: LNK2022, Configuration: Debug Win32 ------ 1>Linking... 1>TestClass.obj : error LNK2022: metadata operation failed (80131188) : Inconsistent field declarations in duplicated types (types: cliext.impl.list_impl; fields: _Myhead): (0x0400000a). 1>TestClass.obj : error LNK2022: metadata operation failed (80131188) : Inconsistent field declarations in duplicated types (types: cliext.impl.list_impl; fields: _Mysize): (0x0400000b). 1>TestClass.obj : error LNK2022: metadata operation failed (80131188) : Inconsistent field declarations in duplicated types (types: cliext.impl.list_impl; fields: _Mygen): (0x0400000c). 1>TestClass.obj : error LNK2022: metadata operation failed (801311D7) : Differing number of fields in duplicated types (cliext.impl.list_impl): (0x02000023). 1>TestClass.obj : error LNK2022: metadata operation failed (8013118B) : Inconsistent implemented interfaces in duplicated types (types: cliext.impl.list_impl; interfaces: System.Runtime.CompilerServices.CallConvStdcall): (0x09000001). 1>TestClass.obj : error LNK2022: metadata operation failed (8013118B) : Inconsistent implemented interfaces in duplicated types (types: cliext.impl.list_impl; interfaces: System.IDisposable): (0x09000002). 1>TestClass.obj : error LNK2022: metadata operation failed (8013118B) : Inconsistent implemented interfaces in duplicated types (types: cliext.impl.list_base; interfaces: System.Runtime.CompilerServices.CallConvFastcall): (0x09000003). 1>TestClass.obj : error LNK2022: metadata operation failed (8013118B) : Inconsistent implemented interfaces in duplicated types (types: cliext.impl.list_base; interfaces: System.Runtime.CompilerServices.CallConvThiscall): (0x09000004). 1>TestClass.obj : error LNK20

      G Offline
      G Offline
      George L Jackson
      wrote on last edited by
      #2

      I think you need to make ref struct SInside access level "public" due to the usage of generics in STL/CLR. However, if this ref struct SInside is only going to be accessed within the same assembly, you can make it's access level "internal" or "protected public".

      "We make a living by what we get, we make a life by what we give." --Winston Churchill

      modified on Thursday, August 28, 2008 3:39 PM

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups