在c+中使用TCL/Tk的未解析外部+;使用cpptk在Windows上的应用 我试图从C++应用程序开始使用TCL/TK。

在c+中使用TCL/Tk的未解析外部+;使用cpptk在Windows上的应用 我试图从C++应用程序开始使用TCL/TK。,c++,tcl,linker-errors,tk,C++,Tcl,Linker Errors,Tk,我使用以下方法: 此库用于将TclTk实现为c++: TCL 8.5.13.0安装于 Visual Studio 2010exp 我已经包含了所有必要的头文件,还链接到了boost和Tcl。 在cpptkbase.cc中,我添加了 #define shared_ptr boost::boost::shared_ptr and #define exception std::exception (known issues according to google) 尝试编译时,我得到

我使用以下方法:

  • 此库用于将TclTk实现为c++:
  • TCL 8.5.13.0安装于
  • Visual Studio 2010exp
我已经包含了所有必要的头文件,还链接到了boost和Tcl。 在cpptkbase.cc中,我添加了

#define shared_ptr boost::boost::shared_ptr    and
#define exception std::exception   (known issues according to google)
尝试编译时,我得到:

1>------ Build started: Project: tcl, Configuration: Debug Win32 ------
1>  tcl.cpp
1>  stdafx.cpp
1>  cpptkbase.cc
1>c:\program\microsoft visual studio 10.0\vc\include\xutility(2227): warning C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
1>          c:\program\microsoft visual studio 10.0\vc\include\xutility(2212) : see declaration of 'std::_Copy_impl'
1>          x:\mycodes\archiv\tcl\tcl\tcl\cpptkbase.cc(138) : see reference to function template instantiation '_OutIt std::copy<std::_String_iterator<_Elem,_Traits,_Alloc>,char*>(_InIt,_InIt,_OutIt)' being compiled
1>          with
1>          [
1>              _OutIt=char *,
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Alloc=std::allocator<char>,
1>              _InIt=std::_String_iterator<char,std::char_traits<char>,std::allocator<char>>
1>          ]
1>  cpptk.cc
1>  Generating Code...
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_Eval referenced in function "public: __thiscall `anonymous namespace'::Interp::Interp(void)" (??0Interp@?A0x9fc9ee39@@QAE@XZ)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tk_Init referenced in function "public: __thiscall `anonymous namespace'::Interp::Interp(void)" (??0Interp@?A0x9fc9ee39@@QAE@XZ)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_Init referenced in function "public: __thiscall `anonymous namespace'::Interp::Interp(void)" (??0Interp@?A0x9fc9ee39@@QAE@XZ)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_CreateInterp referenced in function "public: __thiscall `anonymous namespace'::Interp::Interp(void)" (??0Interp@?A0x9fc9ee39@@QAE@XZ)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_UpdateLinkedVar referenced in function "void __cdecl `anonymous namespace'::linkCpptoTcl(void)" (?linkCpptoTcl@?A0x9fc9ee39@@YAXXZ)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_Alloc referenced in function "void __cdecl `anonymous namespace'::linkCpptoTcl(void)" (?linkCpptoTcl@?A0x9fc9ee39@@YAXXZ)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_Free referenced in function "void __cdecl `anonymous namespace'::linkCpptoTcl(void)" (?linkCpptoTcl@?A0x9fc9ee39@@YAXXZ)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_SetResult referenced in function _callbackHandler
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_CreateObjCommand referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Tk::details::addCallback(class boost::shared_ptr<class Tk::details::CallbackBase>)" (?addCallback@details@Tk@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$shared_ptr@VCallbackBase@details@Tk@@@boost@@@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_LinkVar referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Tk::details::addLinkVar(int &)" (?addLinkVar@details@Tk@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAH@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_UnlinkVar referenced in function "void __cdecl Tk::details::deleteLinkVar(int &)" (?deleteLinkVar@details@Tk@@YAXAAH@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_SetObjResult referenced in function "void __cdecl Tk::details::setResult(bool)" (?setResult@details@Tk@@YAX_N@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_NewBooleanObj referenced in function "void __cdecl Tk::details::setResult(bool)" (?setResult@details@Tk@@YAX_N@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_NewLongObj referenced in function "void __cdecl Tk::details::setResult(long)" (?setResult@details@Tk@@YAXJ@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_NewDoubleObj referenced in function "void __cdecl Tk::details::setResult(double)" (?setResult@details@Tk@@YAXN@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_NewStringObj referenced in function "void __cdecl Tk::details::setResult(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setResult@details@Tk@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_ListObjLength referenced in function "int __cdecl Tk::details::getResultLen(void)" (?getResultLen@details@Tk@@YAHXZ)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_GetObjResult referenced in function "int __cdecl Tk::details::getResultLen(void)" (?getResultLen@details@Tk@@YAHXZ)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_GetIntFromObj referenced in function "int __cdecl Tk::details::getResultElem<int>(int)" (??$getResultElem@H@details@Tk@@YAHH@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_ListObjIndex referenced in function "int __cdecl Tk::details::getResultElem<int>(int)" (??$getResultElem@H@details@Tk@@YAHH@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_GetDoubleFromObj referenced in function "double __cdecl Tk::details::getResultElem<double>(int)" (??$getResultElem@N@details@Tk@@YANH@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_GetString referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl Tk::details::getResultElem<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(int)" (??$getResultElem@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@details@Tk@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_DeleteCommand referenced in function "void __cdecl Tk::deleteCallback(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?deleteCallback@Tk@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tcl_FindExecutable referenced in function "void __cdecl Tk::init(char *)" (?init@Tk@@YAXPAD@Z)
1>cpptkbase.obj : error LNK2019: unresolved external symbol __imp__Tk_MainLoop referenced in function "void __cdecl Tk::runEventLoop(void)" (?runEventLoop@Tk@@YAXXZ)
1>X:\MyCodes\Archiv\tcl\tcl\Debug\tcl.exe : fatal error LNK1120: 25 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
1>----构建已启动:项目:tcl,配置:调试Win32------
1> tcl.cpp
1> stdafx.cpp
1> cpptkbase.cc
1> c:\program\microsoft visual studio 10.0\vc\include\xutility(2227):警告C4996:“std::\u Copy\u impl”:带有可能不安全参数的函数调用-此调用依赖调用方检查传递的值是否正确。要禁用此警告,请使用-D_SCL_SECURE_NO_警告。有关如何使用VisualC++ ++检查迭代器的文档
1> c:\program\microsoft visual studio 10.0\vc\include\xutility(2212):请参阅“std::\u Copy\u impl”的声明
1> x:\mycodes\archiv\tcl\tcl\tcl\cpptkbase.cc(138):请参阅正在编译的函数模板实例化“\u OutIt std::copy(\u InIt,\u InIt,\u OutIt)”的参考
1> 与
1>          [
1> _OutIt=char*,
1> _Elem=char,
1> _Traits=std::char_Traits,
1> _Alloc=std::分配器,
1> _InIt=std::_String_迭代器
1>          ]
1> 政协
1> 正在生成代码。。。
1> cpptkbase.obj:错误LNK2019:函数“public:u thiscall`anonymous namespace'::Interp::Interp(void)”中引用了未解析的外部符号\uuuu imp\uuu Tcl\u Eval)(?0Interp@?A0x9fc9ee39@@QAE@XZ)
1> cpptkbase.obj:错误LNK2019:函数“public:uu thiskall`anonymous namespace'::Interp::Interp(void)”中引用了未解析的外部符号\uuuu imp\uuuu Tk_Init(???0Interp@?A0x9fc9ee39@@QAE@XZ)
1> cpptkbase.obj:错误LNK2019:函数“public:u thiscall`anonymous namespace'::Interp::Interp(void)”中引用了未解析的外部符号\uuuu imp\uuu Tcl\u Init)(?0Interp@?A0x9fc9ee39@@QAE@XZ)
1> cpptkbase.obj:错误LNK2019:函数“public:u thiscall`anonymous namespace'::Interp::Interp(void)”中引用了未解析的外部符号\uuuuu imp\uuuu Tcl\uCreateInterp)(?0Interp@?A0x9fc9ee39@@QAE@XZ)
1> cpptkbase.obj:错误LNK2019:函数“void\uu cdecl`anonymous namespace'::linkcpptocl(void)”(?linkcpptocl@?A0x9fc9ee39@@YAXXZ)中引用了未解析的外部符号
1> cpptkbase.obj:错误LNK2019:函数“void”中引用的未解析外部符号\uuuu imp\uuuu Tcl\u Alloc`anonymous namespace'::linkcpptocl(void)”(?linkcpptocl@?A0x9fc9ee39@@YAXXZ)
1> cpptkbase.obj:错误LNK2019:函数“void\uu cdecl`anonymous namespace'::linkcpptocl(void)”(linkcpptocl@?A0x9fc9ee39@@YAXXZ)中引用了未解析的外部符号
1> cpptkbase.obj:错误LNK2019:未解析的外部符号_imp__Tcl_SetResult在函数callbackHandler中引用
1> cpptkbase.obj:错误LNK2019:未解析的外部符号uuu imp_uutcl_ucreateObjCommand在函数“class std::basic_string uuu cdecl Tk::details::addCallback(class boost::shared_ptr)”中引用(?addCallback@details@Tk@@YA?AV?$basic_string@DU?$char_traits@D@性病病毒$allocator@D@2@@std@@V?$shared_ptr@VCallbackBase@details@Tk@@@boost@@@Z)
1> cpptkbase.obj:错误LNK2019:函数“class std::basic\u string\uu cdecl Tk::details::addLinkVar(int&)”中引用的未解析外部符号uuu imp\uu Tcl\u LinkVar(?addLinkVar@details@Tk@@YA?AV?$basic_string@DU?$char_traits@D@性病病毒$allocator@D@2@@std@@AAH@Z)
1> cpptkbase.obj:错误LNK2019:函数“void”中引用的未解析外部符号\uuuu imp\uuuu Tcl\u UnlinkVar::详细信息::deleteLinkVar(int&)(?deleteLinkVar@details@传统知识@@YAXAAH@Z)
1> cpptkbase.obj:错误LNK2019:函数“void uu cdecl Tk::details::setResult(bool)”中引用的未解析外部符号uu imp u Tcl u SetObjResult)(?setResult@details@Tk@@YAX_N@Z)
1> cpptkbase.obj:错误LNK2019:函数“void\uu cdecl Tk::details::setResult(bool)”中引用的未解析外部符号\uuuuu imp\uuu Tcl\u NewBooleanObj(?setResult@details@Tk@@YAX_N@Z)
1> cpptkbase.obj:错误LNK2019:函数“void\uuu cdecl Tk::details::setResult(long)”中引用的未解析外部符号uuu imp\uu Tcl\u NewLongObj(?setResult@details@传统知识@@YAXJ@Z)
1> cpptkbase.obj:错误LNK2019:函数“void\uuu cdecl Tk::details::setResult(double)”中引用的未解析外部符号uuu imp\uu Tcl\u NewDoubleObj(?setResult@details@传统知识@@YAXN@Z)
1> cpptkbase.obj:错误LNK2019:函数“void”\uuuu cdecl Tk::details::setResult(类std::basic_string const&)中引用了未解析的外部符号\uuu imp\uu Tcl\u NewStringObj(?setResult@details@Tk@@YAXABV?$basic_string@DU?$char_traits@D@性病病毒$allocator@D@2@@@std@@@Z)
1> cpptkbase.obj:错误LNK2019:函数“int u cdecl Tk::details::getResultLen(void)”中引用的未解析外部符号uu imp u Tcl u ListObjLength)(?getResultLen@details@Tk@@YAHXZ)
1> cpptkbase.obj:错误LNK2019:未解析的外部符号uuu imp_uuutcl_ugetobjresult在函数“int uu cdecl Tk::details::getResultLen(void)”中引用(?getResultLen@details@Tk@@YAHXZ)
1> cpptkbase.obj:错误LNK2019:未解析的外部符号uuu imp_uuutcl_ugetIntFromobj在函数“int uu cdecl Tk::details::getResultem(int)”中引用(?)$getResultElem@H@details@Tk@@YAHH@Z)
1> cpptkbase.obj:错误LNK2019:未解析的外部符号u_imp__Tcl_ListObjIndex在函数“int _cdecl Tk::details::getResultem(int)”中引用(?)$getResultElem@H@details@Tk@@YAHH@Z)
1> cpptkbase.obj:错误LNK2019:函数“double\uu cdecl Tk::details::GetResultem(int)”中引用的未解析外部符号uuu imp\uu Tcl\u GetDoubleFromObj(?)$getResultElem@N@details@Tk@@YANH@Z)
1> cpptkbase.obj:错误LNK2019:未解析的外部符号u_imp__Tcl_GetString在函数“class std::basic_string _cdecl Tk::details::getResultem(int)”中引用(?)$getResultElem@V?$basic_string@DU?$char_traits@D@性病病毒$allocator@D@2@@std@@