diff --git a/xmake/templates/c++/xmake.cli/project/src/lni/main.cpp b/xmake/templates/c++/xmake.cli/project/src/lni/main.cpp index 8b9bc45241..80237da161 100644 --- a/xmake/templates/c++/xmake.cli/project/src/lni/main.cpp +++ b/xmake/templates/c++/xmake.cli/project/src/lni/main.cpp @@ -1,4 +1,6 @@ +extern "C" { #include +} static tb_byte_t const g_luafiles_data[] = { #include "luafiles.xmz.h" diff --git a/xmake/templates/c++/xmake.cli/template.lua b/xmake/templates/c++/xmake.cli/template.lua index 45f1135c6a..431e0af1f2 100644 --- a/xmake/templates/c++/xmake.cli/template.lua +++ b/xmake/templates/c++/xmake.cli/template.lua @@ -1,3 +1,3 @@ template("xmake.cli") - add_configfiles("src/lni/main.c") + add_configfiles("src/lni/main.cpp") add_configfiles("xmake.lua")