使用Visual Studio时发生Z3生成错误:致命错误LNK1112:模块计算机类型“x86”与目标计算机类型“x64”冲突

brgchamk  于 2023-10-23  发布在  其他
关注(0)|答案(1)|浏览(148)

我尝试使用Visual Studio 2019在Win10 64 Professional上构建Z3。我按照README说明进行操作,并在“build”目录中点击nmake。在那之后,我得到了以下内容:

cl  /Fez3.exe /nologo /MD shell\datalog_frontend.obj shell\dimacs_frontend.obj shell\drat_frontend.obj shell\gparams_register_modules.obj shell\install_tactic.obj shell\main.obj shell\mem_initializer.obj shell\opt_frontend.obj shell\smtlib_frontend.obj shell\z3_log_frontend.obj api\api.lib cmd_context\extra_cmds\extra_cmds.lib opt\opt.lib tactic\portfolio\portfolio.lib tactic\fpa\fpa_tactics.lib tactic\ufbv\ufbv_tactic.lib tactic\smtlogics\smtlogic_tactics.lib muz\fp\fp.lib muz\bmc\bmc.lib muz\ddnf\ddnf.lib muz\tab\tab.lib muz\clp\clp.lib muz\spacer\spacer.lib muz\rel\rel.lib muz\transforms\transforms.lib muz\dataflow\dataflow.lib muz\base\muz.lib tactic\fd_solver\fd_solver.lib sat\sat_solver\sat_solver.lib qe\qe.lib tactic\sls\sls_tactic.lib smt\tactic\smt_tactic.lib tactic\bv\bv_tactics.lib nlsat\tactic\nlsat_tactic.lib sat\tactic\sat_tactic.lib sat\smt\sat_smt.lib smt\smt.lib smt\proto_model\proto_model.lib math\subpaving\tactic\subpaving_tactic.lib solver\assertions\solver_assertions.lib tactic\arith\arith_tactics.lib tactic\core\core_tactics.lib ast\fpa\fpa.lib ackermannization\ackermannization.lib tactic\aig\aig_tactic.lib ast\pattern\pattern.lib parsers\smt2\smt2parser.lib cmd_context\cmd_context.lib solver\solver.lib qe\lite\qe_lite.lib qe\mbp\mbp.lib tactic\tactic.lib ast\simplifiers\simplifiers.lib ast\converters\converters.lib model\model.lib ast\macros\macros.lib ast\proofs\proofs.lib ast\substitution\substitution.lib ast\normal_forms\normal_forms.lib ast\rewriter\bit_blaster\bit_blaster.lib ast\rewriter\rewriter.lib math\lp\lp.lib nlsat\nlsat.lib sat\sat.lib math\grobner\grobner.lib ast\euf\euf.lib parsers\util\parser_util.lib smt\params\smt_params.lib ast\ast.lib math\subpaving\subpaving.lib math\realclosure\realclosure.lib params\params.lib math\automata\automata.lib math\hilbert\hilbert.lib math\simplex\simplex.lib math\dd\dd.lib math\interval\interval.lib math\polynomial\polynomial.lib util\util.lib /link /profile /MACHINE:X64 /SUBSYSTEM:CONSOLE /STACK:8388608
shell\datalog_frontend.obj : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\cl.EXE"”: return code “0x2”

如何处理这个问题?

gcmastyq

gcmastyq1#

查看命令行,需要链接83个文件以获得结果可执行文件:

shell\datalog_frontend.obj 
shell\dimacs_frontend.obj 
shell\drat_frontend.obj 
shell\gparams_register_modules.obj 
shell\install_tactic.obj 
shell\main.obj 
...
math\dd\dd.lib
math\interval\interval.lib
math\polynomial\polynomial.lib
util\util.lib

我会检查三件事:

  1. shell\datalog_frontend.obj实际上是为64位CPU编译的吗?确保所有目标文件和库都是针对相同的CPU位宽编译的。
    1.是否所有这些文件都是.lib库文件而不是.obj文件?它们应该是.obj文件。
    1.你看过this related post吗?this one呢?
    没有必要自己构建 Z3。下载precompiled binaries

相关问题