【发布时间】:2014-12-21 00:21:25
【问题描述】:
我有以下声明:
DLL EntityHandle scenemanager_create_entity
(SceneManagerHandle handle,
const char* name,
const char* mesh_name,
const char* group_name = 0);
最后一个参数的默认值为group_name = 0。
当我编译 C++ DLL (/TP) 时它工作正常,而在编译宏 DLL 时如下:
#define DLL extern "C" __declspec(dllexport)
但是当我尝试编译与此 DLL 链接的 C 应用程序 (/TC) 时,它会给出错误 C2143: syntax error : missing ')' before '=' 并且宏 DLL 如下:
#define DLL __declspec(dllimport)
【问题讨论】: