繁体   English   中英

VS2013将tcl / tk 8.6.4编译和链接为共享库

[英]VS2013 compiling and linking tcl/tk 8.6.4 as a shared library

这个问题与我之前的编译和链接ngspice问题有关。

ngspice取决于tcl / tk,因此我必须构建它。

我设法在发行版配置中构建tcl,但其他所有操作均失败。

我根据该网站上提供的信息创建了一个批处理。

@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”似乎无害。 我在其中编辑了一个跟踪日志,该工具使用系统调用来识别编译器或链接器选项是否有效。 如果我使用它查看链接器选项'-debug:full'是否有效,则它可以正确识别错误。 对于额外的nmake调用,我还是一无所知。 对所有文件的文本搜索均未显示“ -debug:full”或其片段的来源。

版本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文件的后续调用。 如果您遇到类似的问题,则应在搜索中包括这些问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM