2015-10-09 35 views
0

这个问题与我之前编译和链接ngspice的问题有关。VS2013编译和链接tcl/tk 8.6.4作为共享库

ngspice依赖于tcl/tk,所以我必须构建它。

我设法在发布配置中构建tcl,但其他一切都失败了。

我根据this website上提供的信息创建了一个批次。

@ECHO OFF 
set "vcvars32_bat=C:\LegacyApp\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat" 

REM SET VARIABLES 
call "%vcvars32_bat%" 
set "TCLDIR=..\..\tcl8.6.4" 

echo Building tcl Release 32 
cd tcl8.6.4\win\ 
nmake -f makefile.vc > ..\..\tcl_Release32.log 2>&1 
cd ..\..\ 

echo Building tk Release 32 
cd tk8.6.4\win\ 
nmake -f makefile.vc > ..\..\tk_Release32.log 2>&1 
cd ..\..\ 

echo Building tcl Debug 32 
cd tcl8.6.4\win\ 
nmake -f makefile.vc OPTS=symbols > ..\..\tcl_Debug32.log 2>&1 
cd ..\..\ 

echo Building tk Debug 32 
cd tk8.6.4\win\ 
nmake -f makefile.vc OPTS=symbols > ..\..\tk_Debug32.log 2>&1 
cd ..\..\ 

pause 

exit 0 

我在makefile中添加了一堆消息,所以我可以看到发生了什么。

makefile.vc依赖于rules.vc。不知怎的,一个习惯“帮助者”也参与其中。

下面是一些局部输出:

Microsoft (R) Program Maintenance Utility Version 12.00.21005.1 
Copyright (C) Microsoft Corporation. All rights reserved. 

makefile.vc 
rules.vc 
vercl.x 
=============================================================================== 
*** Compiler has 'Optimizations' 
*** Compiler does not have 'Pentium 0x0f fix' 
*** Linker does not have 'Win98 alignment problem' 
*** Doing symbols 
*** Intermediate directory will be '.\Debug_VC12\tcl_ThreadedDynamic' 
*** Output directory will be '.\Debug_VC12' 
*** Suffix for binaries will be 'tg' 
*** Optional defines are '-DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1' 
*** Compiler version 12. Target machine is IX86 
*** Host architecture is AMD64 
*** Compiler options '-W3 -DUNICODE -D_UNICODE -Ot -Oi -fp:strict -Gs -GS -GL -RTC1 -W3' 
*** Link options '-ltcg' 
cdebug = -Zi -WX -RTC1 
ldebug = -debug -debugtype:cv 
lflags = -nologo -machine:IX86 -ltcg -debug -debugtype:cv 
dlllflags = -nologo -machine:IX86 -ltcg -debug -debugtype:cv -dll 
conlflags = -nologo -machine:IX86 -ltcg -debug -debugtype:cv -subsystem:console 
guilflags = -nologo -machine:IX86 -ltcg -debug -debugtype:cv -subsystem:windows 
*** Dependency rules are not being used. 


Microsoft (R) Program Maintenance Utility Version 12.00.21005.1 
Copyright (C) Microsoft Corporation. All rights reserved. 

=============================================================================== 
*** Compiler has 'Optimizations' 
*** Compiler does not have 'Pentium 0x0f fix' 
*** Linker does not have 'Win98 alignment problem' 
*** Doing symbols 
*** Intermediate directory will be '.\Debug_VC12\itcl_ThreadedDynamic' 
*** Output directory will be '.\Debug_VC12' 
*** Suffix for binaries will be 'tg' 
*** Optional defines are '-DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DTCL_THREADS=1' 
*** Compiler version 12. Target machine is IX86 
*** Host architecture is AMD64 
*** Compiler options ' -Ot -Oi -fp:strict -Gs -GS -GL -RTC1 -W3' 
*** Link options '-ltcg' 
    link -nologo -machine:IX86 -ltcg -debug:full -debugtype:cv -subsystem:windows -dll -base:@D:\Include\CPP\TCLTK\tcl8.6.4\win\..\win\coffbase.txt,itcl -out:".\Debug_VC12\itcl40tg.dll" "D:\Include\CPP\TCLTK\tcl8.6.4\win\..\win\Debug_VC12\tclstub86.lib" @C:\Users\HIRSCH~1\AppData\Local\Temp\nm8789.tmp 
LINK : fatal error LNK1117: syntax error in option 'debug:full' 
NMAKE : fatal error U1077: '"C:\LegacyApp\Microsoft Visual Studio 12.0\VC\BIN\link.EXE"' : return code '0x45d' 
Stop. 

注意NMAKE被称为第二次与不同的选择,我不知道为什么,也可从。

对于我遇到的问题,有没有已知的解决方案?编辑: 我仍然在上面。 'nmakehlp.exe'似乎是无害的。我编辑了一个tracelog,该工具使用系统调用来确定编译器或链接器选项是否有效。如果我用它来查看链接器选项'-debug:full'是否有效,它会正确识别错误。当涉及nmake的额外呼叫时,我仍然无能为力。对所有文件的文本搜索没有揭示'-debug:full'或其片段来自哪里。

回答

0

版本8.5.18没有这个问题,所以我现在只是建立它,而不是8.6.4。

我使用这批帮助建设。

@echo off 
set "vcvars32_bat=D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat" 
set "VERSION=8.5.18" 
set "TCL=tcl%VERSION%" 
set "TK=tk%VERSION%" 
set "TCLDIR=..\..\%TCL%" 

echo %time% > Build.log 
echo "%vcvars32_bat%" >> Build.log 
call "%vcvars32_bat%" >> Build.log 2>&1 
echo %time% >> Build.log 
call:JMP_Build32 %TCL% symbols TCLDebug32.log 
call:JMP_Build32 %TCL% "" TCLRelease32.log 
call:JMP_Build32 %TK% symbols TKDebug32.log 
call:JMP_Build32 %TK% "" TKRelease32.log 
exit 0 

:JMP_Build32 
echo Building '%1' '%2' '%3' 
cd %1\win\ 
echo %time%> ..\..\%3 
del nmakehlp.exe >> ..\..\%3 2>&1 
nmake -f makefile.vc OPTS=%2 >> ..\..\%3 2>&1 
echo %time%>> ..\..\%3 
cd ..\..\ 
goto:eof 

的呼叫nmake -f makefile.vc导致后续调用在姐姐的目录其他makefile.vc文件。如果你遇到类似的问题,你应该在搜索中包含这些问题。