description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: Fatal Error C1308 |
Fatal Error C1308 |
11/04/2016 |
|
|
46177997-069e-433a-8e20-93c846d78ffd |
linking assemblies is not supported
A .netmodule is allowed as input to the linker, but an assembly is not. This error can be generated when an attempt is made to link an assembly compiled with /clr:safe
.
For more information, see .netmodule Files as Linker Input.
The following sample generates C1308:
// C1308.cpp
// compile with: /clr:safe /LD
public ref class MyClass {
public:
int i;
};
and then,
// C1308b.cpp
// compile with: /clr /link C1308b.obj C1308.dll
// C1308 expected
#using "C1308.dll"
int main() {
MyClass ^ my = gcnew MyClass();
}