Fatal Error C1308
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();
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for