本人在开源代码sumatrapdf里面下载最新的代码进行编译,本机下载最先专业版VS2017进行运行,不过老是编译运行报错,我在开源网站想作者咨询。
版本:https://github.com/sumatrapdfreader/sumatrapdf
问题:https://github.com/sumatrapdfreader/sumatrapdf/issues/1031
Please help me. When I download the latest version(sumatrapdf-master.zip), I use VS2017 to run the wrong report.My laptop win10 64 bit,When I unzip the file, open vs2017/SumatraPDF.sln, compile and run error.
----------------------------------ERROR-----------------------------------------------------------
Severity code indicates that item file rows are forbidden to display state.
Error MSB8020 could not find the v141_xp generation tool (platform toolset = "v141_xp"). If you want to use the v141_xp generation tool to generate, install the v141_xp generation tool. Or, you can upgrade to the current Visual Studio tool by selecting the "project" menu or right-click the solution, and then selecting the "redefine solution target". Cmapdump D:\Program\VisualStudio2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets 57
I hope you can teach me how to run it, compile those files, and guide me according to your successful compilation. Thank you.
kjk回答:您很可能需要重新运行Visual Studio安装程序,并确保安装XP工具链组件。
当我重新安装VS2017把XP的安装上,重新运行,不过还是有报错:
Today,when i re-run Visual Studio installer and make sure to install XP toolchain component.
----------------------------------ERROR-----------------------------------------------------------
1>------ Build started: Project: synctex, Configuration: Debug x64 ------
2>------ Build started: Project: mupdf, Configuration: Debug x64 ------
1>synctex_parser.c
1>d:\sumatrapdf-master\ext\synctex\synctex_parser.c(715): error C2220: warning treated as error - no 'object' file generated
1>d:\sumatrapdf-master\ext\synctex\synctex_parser.c(715): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>Done building project "synctex.vcxproj" -- FAILED.
2>pdf-write.c
2>d:\sumatrapdf-master\mupdf\source\pdf\pdf-write.c(2075): error C2220: warning treated as error - no 'object' file generated
2>d:\sumatrapdf-master\mupdf\source\pdf\pdf-write.c(2075): warning C4819: The file contains a character that cannot be represented in the current code page (0). Save the file in Unicode format to prevent data loss
2>Done building project "mupdf.vcxproj" -- FAILED.
3>------ Build started: Project: SumatraPDF, Configuration: Debug x64 ------
3>LINK : fatal error LNK1104: cannot open file 'D:\sumatrapdf-master\dbg64\mupdf.lib'
3>Done building project "SumatraPDF.vcxproj" -- FAILED.
========== Build: 0 succeeded, 3 failed, 16 up-to-date, 0 skipped ==========
How is this going?
kjk回答:修改pdf-write.c第2075行的代码,然后synctex_parser.c从新保存一下文件就可以了
pdf-write.c
row 2075
//fprintf(opts->out, "%%\316\274\341\277\246\n\n"); //wrong
fprintf(opts->out, "%%\xC2\xB5\xC2\xB6\n\n"); //ok---come from mupdf-1.12.0-source
You can disable that warning. It's caused by using non-english OS.
重新运行,终于可以了,最新本部3.2