2015-10-09 71 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文件。如果你遇到類似的問題,你應該在搜索中包含這些問題。