次の方法で共有


コンパイラ エラー C3618

'function': DllImport と記述されているメソッドを定義できません

DllImportAttribute でマークされているメソッドが specified.DLL で定義されています。

次の例では C3618 が生成されます。

// C3618.cpp
// compile with: /clr /c
using namespace System;
using namespace System::Runtime::InteropServices;

[ DllImport("user32.dll", EntryPoint="MessageBox", CharSet=CharSet::Ansi) ]  // CHANGED
void Func();

void Func() {}   // C3618, remove this function definition to resolve