diff --git a/libgnucash/backend/xml/gnc-xml-backend.cpp b/libgnucash/backend/xml/gnc-xml-backend.cpp index f1aa9e5109..b1c7deba54 100644 --- a/libgnucash/backend/xml/gnc-xml-backend.cpp +++ b/libgnucash/backend/xml/gnc-xml-backend.cpp @@ -28,6 +28,9 @@ #include #include #include +#if COMPILER(MSVC) +# define g_fopen fopen +#endif #include //for GNC_MOD_BACKEND #include @@ -337,7 +340,7 @@ GncXmlBackend::save_may_clobber_data() void GncXmlBackend::export_coa(QofBook* book) { - auto out = fopen(m_fullpath.c_str(), "w"); + auto out = g_fopen(m_fullpath.c_str(), "w"); if (out == NULL) { set_error(ERR_FILEIO_WRITE_ERROR);