0
我得到错误:C函数的解析void msgBox(const char *,const char *)'与之前的冲突在我的DLL中声明'void msgBox(const char *)'这里,正在MinGW中编译。为什么它不接受我的声明?C函数声明'void msgBox(const char *,const char *)'与前面的声明冲突
#include <windows.h>
#define DLL_EXPORT __declspec(dllexport)
extern "C"
{
void DLL_EXPORT msgBox(const char* msgText);
void DLL_EXPORT msgBox(const char* msgText, const char* msgTitle);
}
嗯,因为我有一个C++程序链接它,这将是安全的,完全去除*为extern “C” *一部分? –
@ MonetR.Adams:如果你只使用C++并且它是相同的编译器,那么你不需要'extern“C”'。 –
因此,编译时或者在头文件中不需要* extern“C”*?对? –