Export (0) Print
Expand All
Expand Minimize

Compiler Error C3846

'symbol' : cannot import symbol from 'assembly2': as 'symbol' has already been imported from another assembly 'assembly1'

A symbol could not be imported from a referenced assembly because it was previously imported from a referenced assembly.

The following sample generates C3846:

// C3846a.cpp
// compile with: /LD /clr
public ref struct G
{
};

And then compile this:

// C3846b.cpp
// compile with: /clr
#using "c3846a.dll"
#using "c3846a.obj"   // C3846

int main()
{
}

The following sample generates C3846:

// C3846c.cpp
// compile with: /LD /clr:oldSyntax
#using <mscorlib.dll>
using namespace System;

public __gc struct G
{
};

And then compile this:

// C3846d.cpp
// compile with: /clr:oldSyntax
#using <mscorlib.dll>
using namespace System;
#using "c3846c.dll"
#using "c3846c.obj"   // C3846

int main()
{
}

Community Additions

ADD
Show:
© 2014 Microsoft