texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.76k stars 343 forks source link

Build error with MSVC since 4.6.0 #3247

Open minnyres opened 1 year ago

minnyres commented 1 year ago

The error comes when compiling the file synctex_parser.c. It seems related to commit https://github.com/texstudio-org/texstudio/commit/be4a060291a9aab605ddbf97dcbd2b847c3a64ee.

[213/228] Building C object CMakeFiles\texstudio.dir\src\pdfviewer\synctex\synctex_parser.c.obj
FAILED: CMakeFiles/texstudio.dir/src/pdfviewer/synctex/synctex_parser.c.obj 
C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1435~1.322\bin\HostX64\arm64\cl.exe  /nologo -DADWAITA -DHUNSPELL_STATIC -DNO_CRASH_HANDLER -DNO_TESTS -DPROJECT_VERSION=\"4.6.0\" -DPROJECT_VERSION_INT=40600 -DQNFA_BUILD -DQT_CONCURRENT_LIB -DQT_CORE5COMPAT_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGLWIDGETS_LIB -DQT_OPENGL_LIB -DQT_PRINTSUPPORT_LIB -DQT_QMLINTEGRATION_LIB -DQT_QML_LIB -DQT_SVG_LIB -DQT_UITOOLS_LIB -DQT_WIDGETS_LIB -DQT_XML_LIB -DQUAZIP_STATIC -DTEXSTUDIO_VERSION=\"4.6.0\" -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_QCODE_EDIT_BUILD_ -D_UNICODE -D_WIN64 -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\build -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\build\texstudio_autogen\include -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\qtsingleapplication -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\hunspell -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\qcodeedit\lib -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\qcodeedit\lib\document -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\qcodeedit\lib\widgets -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\qcodeedit\lib\qnfa -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\qcodeedit -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\debug -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\latexparser -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\symbolpanel -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\adwaita-qt -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\adwaita-qt\style -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\adwaita-qt\style\animations -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\adwaita-qt\style\debug -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\quazip -ID:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\quazip\quazip -external:IC:\vcpkg\installed\arm64-windows-release\include -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtCore -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\mkspecs\win32-arm64-msvc -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtGui -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtWidgets -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtPrintSupport -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtSvg -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtNetwork -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtXml -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtQml -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtQmlIntegration -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtConcurrent -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtUiTools -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtOpenGLWidgets -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtOpenGL -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtCore5Compat -external:ID:\a\texstudio-windows-arm64\qt-msvc-arm64\include\QtDBus -external:ID:\a\texstudio-windows-arm64\poppler-msvc-arm64\include\poppler\cpp -external:ID:\a\texstudio-windows-arm64\poppler-msvc-arm64\include\poppler\qt6 -external:W0 /DWIN32 /D_WINDOWS /W3 /MD /O2 /Ob2 /DNDEBUG /wd4267 /wd4244 /MP -utf-8 /showIncludes /FoCMakeFiles\texstudio.dir\src\pdfviewer\synctex\synctex_parser.c.obj /FdCMakeFiles\texstudio.dir\ /FS -c D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c
Error: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8440): error C2143: syntax error: missing ')' before 'constant'
Error: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8440): error C2143: syntax error: missing '{' before 'constant'
Error: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8440): error C2059: syntax error: 'constant'
Error: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8440): error C2059: syntax error: ')'
Error: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8477): error C2143: syntax error: missing ')' before 'constant'
Error: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8477): error C2143: syntax error: missing '{' before 'constant'
Error: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8477): error C2059: syntax error: 'constant'
Error: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8477): error C2059: syntax error: ')'
Error: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8538): error C2065: '_synctex_updater_print': undeclared identifier
Warning: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8538): warning C4047: '=': 'synctex_print_f' differs in levels of indirection from 'int *'
Error: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8544): error C2065: '_synctex_updater_print_gz': undeclared identifier
Warning: D:\a\texstudio-windows-arm64\texstudio-windows-arm64\texstudio\src\pdfviewer\synctex\synctex_parser.c(8544): warning C4047: '=': 'synctex_print_f' differs in levels of indirection from 'int *'
ninja: build stopped: subcommand failed.
Error: Process completed with exit code 1.
minnyres commented 1 year ago

This problem seems solved with the patch

diff --git a/src/pdfviewer/synctex/synctex_parser_utils.h b/src/pdfviewer/synctex/synctex_parser_utils.h
index 19ab779db..ccbfba45e 100644
--- a/src/pdfviewer/synctex/synctex_parser_utils.h
+++ b/src/pdfviewer/synctex/synctex_parser_utils.h
@@ -87,7 +87,7 @@ extern "C" {
 #  endif

 #  if defined(_MSC_VER)
-#      define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK)
+#      define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) // ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK)
 #  else
 #      define SYNCTEX_ATTRIBUTE_FORMAT_PRINTF(STRING_INDEX, FIRST_TO_CHECK) __attribute__((__format__ (__printf__, (STRING_INDEX), (FIRST_TO_CHECK))))
 #  endif
easyentry commented 1 year ago

@minnyres Hello and thanks very much for all your arm64 ports! Please, send me your email to contact@technique.cz and visit my arm64 group at MDL: https://forums.mydigitallife.net/threads/repository-everything-about-windows-rt-woa-v8-x-x-and-v10-arm.57362/page-48 Offtopic: Please, could you help me with this: https://forums.mydigitallife.net/threads/repository-everything-about-windows-rt-woa-v8-x-x-and-v10-arm.57362/page-40#post-1796462 Thanks.