chuyu-team / vc-ltl Goto Github PK
View Code? Open in Web Editor NEWShared to msvcrt.dll and optimize the C/C++ application file size.
License: Eclipse Public License 2.0
Shared to msvcrt.dll and optimize the C/C++ application file size.
License: Eclipse Public License 2.0
无法解析的外部符号 "struct std::nothrow_t const std::nothrow" (?nothrow@std@@3Unothrow_t@1@B),该符号在函数 "public: int __thiscall ATL::CExpansionVector::Add(wchar_t const *,wchar_t const *)" (?Add@CExpansionVector@ATL@@QAEHPB_W0@Z) 中被引用
分析:
statreg.h文件中CExpansionVector::Add用到了_ATL_NEW
_ATL_NEW的定义在atldef.h中,#define _ATL_NEW new(std::nothrow)
解决:
方案一、在自己的程序里定义一个全局变量 struct std::nothrow_t const std::nothrow;
方案二、预定义_ATL_DISABLE_NOTHROW_NEW
都是找不到XXXX,估计是没有支持,希望能够加入支持.
具体问题比较多,请编译PPSSPP,一目了然.
PPSSPP官方项目地址:
https://github.com/hrydgard/ppsspp
如何编译(官方Wiki):
https://github.com/hrydgard/ppsspp/wiki/Build-instructions
PS:它的默认是7.0的sdk而且无法切换到win10.我并没有编译其中支持UWP的版本,只是普通win32 X64 Release.
谢谢.
IDA看了下都是msvcp140的东西
是不是msvcp140没做兼容。。。
1>wsclient.obj : error LNK2001: 无法解析的外部符号 __imp___Query_perf_frequency
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall std::_Lockit::~_Lockit(void)" (_imp??1_Lockit@std@@QAE@XZ)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall std::_Lockit::_Lockit(int)" (_imp??0_Lockit@std@@QAE@H@Z)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits > std::cout" (_imp?cout@std@@3v?$basic_ostream@DU?$char_traits@D@std@@@1@A)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (_imp?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) private: static class std::locale::_Locimp * __cdecl std::locale::_Init(bool)" (_imp?_Init@locale@std@@CAPAV_Locimp@12@_N@Z)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: static class std::locale const & __cdecl std::locale::classic(void)" (_imp?classic@locale@std@@SAABV12@XZ)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) bool __cdecl std::uncaught_exception(void)" (_imp?uncaught_exception@std@@YA_NXZ)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) unsigned long __cdecl std::_Winerror_message(unsigned long,char *,unsigned long)" (_imp?_Winerror_message@std@@YAKKPADK@Z)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) __int64 const std::_BADOFF" (_imp?_BADOFF@std@@3_JB)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits > std::cerr" (_imp?cerr@std@@3v?$basic_ostream@DU?$char_traits@D@std@@@1@A)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) int __cdecl std::_Winerror_map(int)" (_imp?_Winerror_map@std@@yahh@Z)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) void __cdecl std::_Throw_C_error(int)" (_imp?_Throw_C_error@std@@Yaxh@Z)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "void __cdecl std::_Facet_Register(class std::_Facet_base *)" (?_Facet_Register@std@@YAXPAV_Facet_base@1@@z)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: static class std::locale::id std::ctype::id" (_imp?id@?$ctype@D@std@@2V0locale@2@A)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) char const * __cdecl std::_Syserror_map(int)" (_imp?_Syserror_map@std@@YAPBDH@Z)
1>wsclient.obj : error LNK2001: 无法解析的外部符号 __imp___Mtx_destroy_in_situ
1>wsclient.obj : error LNK2001: 无法解析的外部符号 __imp____std_type_info_compare
1>wsclient.obj : error LNK2001: 无法解析的外部符号 __imp___Mtx_lock
1>wsclient.obj : error LNK2001: 无法解析的外部符号 __imp___Mtx_init_in_situ
1>wsclient.obj : error LNK2001: 无法解析的外部符号 __imp___Query_perf_counter
1>wsclient.obj : error LNK2001: 无法解析的外部符号 __imp___Mtx_unlock
如题,vs2017
1>libconcrt.lib(SchedulerProxy.obj) : error LNK2001: 无法解析的外部符号 __RTDynamicCast
1>msvcrt_Platform.lib(__RTDynamicCast.obj) : error LNK2001: 无法解析的外部符号 __RTDynamicCast
1>msvcrt_Platform.lib(__RTDynamicCast.obj) : error LNK2001: 无法解析的外部符号 RTDynamicCast_downlevel
When compiling the x64 release, it fails with:
1>vc.lib(loadcfg.obj) : error LNK2001: unresolved external symbol __enclave_config
However x86 builds are fine.
反馈者:@myfreeer
影响:低
相关信息:
VC-LTL/ucrt/10.0.10240.0/stdlib.h
Line 60 in 39d232b
warning C4566: character represented by universal-character-name '\u529F' cannot be represented in the current code page (1252)
1>------ 已启动全部重新生成: 项目: XamlCalendar, 配置: Release x64 ------
1>pch.cpp
1>d:\projects\source\github\vc-ltl\ucrt\10.0.16299.0...._msvcrt.h(103) : info: 进入ltl普通模式,已准备对ltlxp.lib的引用。定义 __NO_LTL_LIB 可切换到超越模式。
1>D:\Projects\Source\GitHub\VC-LTL\ucrt\10.0.16299.0\corecrt_math.h(553): warning C4244: “参数”: 从“long double”转换到“double”,可能丢失数据
1>D:\Projects\Source\GitHub\VC-LTL\ucrt\10.0.16299.0\corecrt_math.h(970): warning C4244: “参数”: 从“long double”转换到“double”,可能丢失数据
1>D:\Projects\Source\GitHub\VC-LTL\ucrt\10.0.16299.0\corecrt_math.h(977): warning C4244: “参数”: 从“long double”转换到“double”,可能丢失数据
1>App.cpp
1>LINK : warning LNK4010: 子系统版本号 5.02 无效;假定为默认子系统版本
1>ltlxp.lib(_msvcrt.obj) : error LNK2001: 无法解析的外部符号 SystemFunction036
1>vc.lib(guard_support.obj) : error LNK2001: 无法解析的外部符号 _guard_dispatch_icall_nop
1>Release\x64\XamlCalendar.exe : fatal error LNK1120: 2 个无法解析的外部命令
1>已完成生成项目“XamlCalendar.vcxproj”的操作 - 失败。
已取消生成。
cppwinrt项目地址:
https://github.com/Microsoft/cppwinrt
此项目已加入Windows SDK (insider)
https://moderncpp.com/2017/11/15/cppwinrt-exe-in-the-windows-sdk/
VS2017 15.5.3.
但VC-LTL中没有 winres.h
期待补充进来
或许只要在VC\141\atlmfc\include 直接复制一下winres.h 或者 afxres.h 进来?
当然 我是菜鸟 如果有错望指点
请求添加VS2019支持
Unknown MSVC_VERSION=1920
VS2019 Perview 2 增强了Cmake的支持.
测试Cmake项目时发现还未支持此版本visual studio.
代码里用到typeid().name()时
error LNK2001: unresolved external symbol __imp____std_type_info_name
msvcrt_base.lib(tncleanup.obj) : error LNK2001: unresolved external symbol ___clean_type_info_names_internal
目前已知至少从2015开始的这批函数在xp模式下面编译的代码在xp下是不能正常运行的,返回值是-1。我是在编译flac的时候发现这个问题的,在反复检查后最终发现是微软的库的实现问题,从网上查到的信息,这个问题三年前就有人提出来了,甚至vs项目组也知道,还有微软员工声称已经已经修复了,但是实际上到今天为止仍然没有修正,看来这辈子是不用指望微软了。
这个并不是VC-LTL的bug,不过我想来想去,把修正放在LTL这个里面再合适不过了。如果在其它库中修正,每个项目都要从底层修改,非常麻烦兼丑陋。
LNK2005 "protected: __cdecl std::basic_streambuf<char,struct std::char_traits >::basic_streambuf<char,struct std::char_traits >(void)" (??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@iEAA@XZ) 已经在 native.lib(stringutil.obj) 中定义
LNK2001 无法解析的外部符号 __imp___stdio_common_vsprintf
LNK2001 无法解析的外部符号 __imp___stdio_common_vfprintf
LNK2001 无法解析的外部符号 __std_exception_copy
已经提交了NDEBUG的问题.使用了最新的VC-LTL.
就是mbctable, mbbtable, LcidToLocaleNameTable, LocaleNameToIndexTable這些沒有引用過用過的變量在浪費空間, 11K呀😥
反馈者:风清凉
影响平台:VS2017 + O2编译(Od以及O1均正常,另外不用VC-LTL也正常)
严重等级:严重
表现:Duilib弹出模态窗口一定几率导致父创建界面不刷新。
临时解决方案:暂时不用VC-LTL或者用O1或者降级到2015。
这可能是VS2017 代码优化器存在BUG,遇到特殊代码导致编译的二进制代码有误。
此问题需要继续跟踪。
Try provide single header.
请问没有预编译头的跨平台开源项目怎么#include<_msvcrt.h/cpp>?
我试着加在main所在cpp的最前面,编译阶段出错:
...\VC-LTL\VC140\corecrt_wstdio.h(1061): error C3861: “_vscwprintf_l”: 找不到标识符
...\VC-LTL\VC140\corecrt_wstdio.h(1061): error C3861: “_vswprintf_l”: 找不到标识符
...\VC-LTL\VC140\corecrt_wstdio.h(1163): error C3861: “_vscwprintf_l”: 找不到标识符
...\VC-LTL\VC140\corecrt_wstdio.h(1163): error C3861: “_vswprintf_l”: 找不到标识符
...\VC-LTL\VC140\corecrt_wstdio.h(1267): error C3861: “_vscwprintf_l”: 找不到标识符
请问这些函数是在哪个.h里#include的?
谢谢
尝试编译的工程:https://github.com/schnaader/precomp-cpp
编译libcurl时少了__imp____sys_nerr和__imp___getpid
我在编译一个github上下载的工程的时候引入您的配置,发现编译会有这个错误,看了网上的解决方案是忽略 libcmt,但是忽略的话会有更多的错误,我编译的是github上的xmrig x64
bug标题(Describe the bug)
使用VC-LTL后仍会提示丢失MSVCRXXX.dll
如何重现此问题?(To Reproduce)
Steps to reproduce the behavior:
按教程使用V141工具集编译程序并运行,启用强制XP兼容模式
程序:https://github.com/nagist/metahook
预期行为(Expected behavior)
正常情况应该是怎么样的?
正常启动HL
相关截图(Screenshots)
相关错误截图,截图最好大一点。
If applicable, add screenshots to help explain your problem.
提示计算机丢失MSVCR120.dll MSVCR100.dll
环境信息:(Information)
其他信息(Additional context)
其他有关于这个问题的内容。
使用v141工具集编译,并启用强制XP兼容模式
错误报告:
1>已完成代码的生成
1>vc141.lib(loadcfg.obj) : error LNK2001: 无法解析的外部符号 __guard_ss_verify_failure
1>vc141.lib(guard_support.obj) : error LNK2001: 无法解析的外部符号 __guard_ss_verify_failure_default
1>vc141.lib(guard_support.obj) : error LNK2001: 无法解析的外部符号 __guard_ss_verify_sp_default
当开启/clr:pure
时,无法正常使用VC-LTL。
低(仅影响纯MSIL模式,混合模式不受影响)
此问题是已知问题,暂时还在评估是否需要支持/clr:pure
,如有需要者,可以直接回复。
我们会根据用户的反应情况,来决定是否需要支持。
1>boost_container-vc140-mt.lib(synchronized_pool_resource.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_LTL_DynamicRelease' in GameHookManager.Hooks.obj
1>boost_container-vc140-mt.lib(dlmalloc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_LTL_DynamicRelease' in <REDACTED>.obj
1>boost_container-vc140-mt.lib(pool_resource.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_LTL_DynamicRelease' in <REDACTED>.obj
1>boost_container-vc140-mt.lib(global_resource.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_LTL_DynamicRelease' in <REDACTED>.obj
1>boost_math_tr1-vc140-mt.lib(sph_neumann.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_LTL_DynamicRelease' in <REDACTED>.obj
1>boost_math_tr1-vc140-mt.lib(pch.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_LTL_DynamicRelease' in <REDACTED>.obj
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>boost_container-vc140-mt.lib(synchronized_pool_resource.obj) : error LNK2001: unresolved external symbol ___std_exception_copy
1>boost_container-vc140-mt.lib(pool_resource.obj) : error LNK2001: unresolved external symbol ___std_exception_copy
1>boost_container-vc140-mt.lib(global_resource.obj) : error LNK2001: unresolved external symbol ___std_exception_copy
1>boost_math_tr1-vc140-mt.lib(sph_neumann.obj) : error LNK2001: unresolved external symbol ___std_exception_copy
1>boost_container-vc140-mt.lib(synchronized_pool_resource.obj) : error LNK2001: unresolved external symbol ___std_exception_destroy
1>boost_container-vc140-mt.lib(pool_resource.obj) : error LNK2001: unresolved external symbol ___std_exception_destroy
1>boost_container-vc140-mt.lib(global_resource.obj) : error LNK2001: unresolved external symbol ___std_exception_destroy
1>boost_math_tr1-vc140-mt.lib(sph_neumann.obj) : error LNK2001: unresolved external symbol ___std_exception_destroy
1>boost_math_tr1-vc140-mt.lib(sph_neumann.obj) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf_s
附上解決方法:
1. 先將X:\...\vcpkg\installed\x86-windows-static\lib 改成 X:\...\vcpkg\installed\x86-windows-static\libwtf
2. 編譯
3. 再改回lib
之前一直OK。。。改了MD_DynamicRelease至MD_LTL_DynamicRelease?
当前版本VC_LTL不支持LLVM工具集编译,我做了一些修改让VC-LTL强行支持:
1.\VCLTL\config\config.props
<!--计算机已经安装LLVM-->
<VC-LTLUsedToolsVersion Condition=" ('$(VC-LTLUsedToolsVersion)'=='') And ('$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM'!='') ">14.0.24231</VC-LTLUsedToolsVersion>
<VC-LTLUsedToolsVersion Condition=" ('$(VC-LTLUsedToolsVersion)'=='') And ('$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM'!='') " >14.0.24231</VC-LTLUsedToolsVersion>
<SupportPlatformToolsetNormal Condition="('$(SupportPlatformToolsetNormal)'=='') And ('$(PlatformToolset)'=='v140')">true</SupportPlatformToolsetNormal>
<SupportPlatformToolsetNormal Condition="('$(SupportPlatformToolsetNormal)'=='') And ('$(PlatformToolset)'=='v141')">true</SupportPlatformToolsetNorma>
<SupportPlatformToolsetNormal Condition="('$(SupportPlatformToolsetNormal)'=='') And ('$(PlatformToolset)'=='LLVM-vs2015_xp')">true</SupportPlatformToolsetNormal>
<SupportPlatformToolsetNormal Condition="('$(SupportPlatformToolsetNormal)'=='') And ('$(PlatformToolset)'=='LLVM-vs2017_xp')">true</SupportPlatformToolsetNormal>
<SupportPlatformToolsetNormal Condition="('$(SupportPlatformToolsetNormal)'=='') And ('$(PlatformToolset)'=='LLVM-vs2015')">true</SupportPlatformToolsetNormal>
<SupportPlatformToolsetNormal Condition="('$(SupportPlatformToolsetNormal)'=='') And ('$(PlatformToolset)'=='LLVM-vs2017')">true</SupportPlatformToolsetNormal>
2.修改\VCLTL_msvcrt.h为UTF-8编码
3.修改\VCLTL\ucrt\10.0.xxxxx.0\中头文件(如stdio.h)可能出现的unicode LTL提示文本,全部删除或修改为UTF8
提示是这样的
warning LTL3000: VC-LTL不支持 VC 14.15.26726,已临时切换到 VC 14.14.26428 来维持基础功能。这可能是你的IDE版本过低,建议升级到最新IDE然后继续!****
能编译,但是会提示如下信息:
1>D:\VC-LTL-3.0.0.1\Config\config.props(172,5): warning LTL3000: VC-LTL不支持 VC 14.14.26428,已临时切换到 VC 14.10.25017 来维持基础功能。这可能是你的IDE版本过低,建议升级到最新IDE然后继续!
1>D:\VC-LTL-3.0.0.1\Config\config.props(173,5): warning LTL3001: VC-LTL不支持 SDK 10.0.17134.0,目前已临时切换到 SDK 10.0.10240.0 来维持基础功能。这可能是你的SDK版本过低,建议切换到最新SDK然后继续!
1>aqsync.c
1>d:\vc-ltl-3.0.0.1\config\vista\ltl_config.h(21) : note: 进入ltl普通模式,已准备引用到VC-LTL。定义 _DISABLE_DEPRECATE_LTL_MESSAGE 可关闭信息提示。
1>d:\vc-ltl-3.0.0.1\_msvcrt.h(69): warning LTL1000: 此工具集已经停止维护,强烈建议你请升级到最新Vistual Studio 2017 15.5或者更高版本然后继续!
东西是好,可惜crt版本太高,用不了..
#include
int main(int argc, char* argv[])
{
std::cout << "hello!" << std::endl;
return 0;
}
编译不过
1>ltl140xp.lib(_msvcrt.obj) : warning LNK4217: 本地定义的符号 __invoke_watson 在函数 __invalid_parameter_noinfo_noreturn 中导入
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) bool __cdecl std::uncaught_exception(void)" (_imp?uncaught_exception@std@@YA_NXZ),该符号在函数 __catch$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$0 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: int __thiscall std::basic_streambuf<char,struct std::char_traits >::sputc(char)" (_imp?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z),该符号在函数 "class std::basic_ostream<char,struct std::char_traits > & __cdecl std::operator<<<struct std::char_traits >(class std::basic_ostream<char,struct std::char_traits > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __int64 __thiscall std::basic_streambuf<char,struct std::char_traits >::sputn(char const *,__int64)" (_imp?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z),该符号在函数 "class std::basic_ostream<char,struct std::char_traits > & __cdecl std::operator<<<struct std::char_traits >(class std::basic_ostream<char,struct std::char_traits > &,char const )" (??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall std::basic_ios<char,struct std::char_traits >::setstate(int,bool)" (_imp?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z),该符号在函数 __catch$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$0 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: char __thiscall std::basic_ios<char,struct std::char_traits >::widen(char)const " (_imp?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z),该符号在函数 "class std::basic_ostream<char,struct std::char_traits > & __cdecl std::endl<char,struct std::char_traits >(class std::basic_ostream<char,struct std::char_traits > &)" (??$endl@DU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@@z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall std::basic_ostream<char,struct std::char_traits >::_Osfx(void)" (_imp?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ),该符号在函数 __catch$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$0 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits > & __thiscall std::basic_ostream<char,struct std::char_traits >::operator<<(class std::basic_ostream<char,struct std::char_traits > & (__cdecl)(class std::basic_ostream<char,struct std::char_traits > &))" (_imp??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@z@Z),该符号在函数 _main 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits > & __thiscall std::basic_ostream<char,struct std::char_traits >::put(char)" (_imp?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z),该符号在函数 "class std::basic_ostream<char,struct std::char_traits > & __cdecl std::endl<char,struct std::char_traits >(class std::basic_ostream<char,struct std::char_traits > &)" (??$endl@DU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@@z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: class std::basic_ostream<char,struct std::char_traits > & __thiscall std::basic_ostream<char,struct std::char_traits >::flush(void)" (_imp?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ),该符号在函数 "class std::basic_ostream<char,struct std::char_traits > & __cdecl std::operator<<<struct std::char_traits >(class std::basic_ostream<char,struct std::char_traits > &,char const *)" (??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) 中被引用
1>main.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits > std::cout" (_imp?cout@std@@3v?$basic_ostream@DU?$char_traits@D@std@@@1@A)
1>D:\VS2015\cc\Release\cc.exe : fatal error LNK1120: 10 个无法解析的外部命令
如题?在使用中发现不再依赖msvcr140.dll,有支持msvcp140解依赖的打算吗?
VS2017
ICU 6.31
VC-LTL-4.0.0.26-Binary-VS2017.7z
make 阶段
Unpacking ./in/icudt63l.dat and generating out/tmp/icudata.lst (list of data files)
PATH=../lib:../stubdata:../tools/ctestfw:$PATH ../bin/icupkg -d ./out/build/icudt63l --list -x * ./in/icudt63l.dat -o out/tmp/icudata.lst
usage: icupkg.exe [-h|-?|--help ] [-tl|-tb|-te] [-c] [-C comment]
[-a list] [-r list] [-x list] [-l [-o outputListFileName]]
[-s path] [-d path] [-w] [-m mode]
[--auto_toc_prefix] [--auto_toc_prefix_with_type] [--toc_prefix]
infilename [outfilename]
make[1]: *** [Makefile:493: out/tmp/icudata.lst] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/John/Desktop/icu/source/data'
make: *** [Makefile:153: all-recursive] Error 2
如果不加载VC-LTL nmake helper则不会出现此问题
xp模式编译chromium时,出现无法解析的外部符号__imp___configthreadlocale
编译qt 5.6.3中qwebengine模块时,在链接时出现符号解析错误:
*skia_library.lib(skia_library.GrGLProgramBuilder.obj) : error LNK2019: 无法解析的外部符号 __imp___configthreadlocale,该符号在函数 "public: static class GrGLProgram * __cdecl GrGLProgramBuilder::CreateProgram(struct GrGpu::DrawArgs const &,class GrGLGpu )" (?CreateProgram@GrGLProgramBuilder@@SAPAVGrGLProgram@@ABUDrawArgs@GrGpu@@PAVGrGLGpu@@@z) 中被引用
....\lib\Qt5WebEngineCore.dll : fatal error LNK1120: 1 个无法解析的外部命令
环境信息:(Information)
其他信息(Additional context)
其他有关于这个问题的内容。
Add any other context about the problem here.
我应该没看错……VC-LTL\config中的config.props里面
msvcrt_Platform.lib;ltl.lib;vc.lib;ucrt.lib;%(AdditionalDependencies)
msvcrt_Platform.lib这个文件是不存在的。
辛苦了,common是编译通过了,但是其他工程好像还是不行。
另外推荐一种配置方式:
1.环境变量中添加VC-LTL:你的VC-LTL的git版本存放路径
2.工程INCLUDE路径中添加:
3.工程LIB路径中添加: :$(VC-LTL)$(PlatformShortName);$(VC-LTL)\VC$(PlatformToolsetVersion)\lib$(PlatformShortName);$(VC-LTL)\ucrt$(TargetUniversalCRTVersion)\lib$(PlatformShortName);
应该能编译出来整个icu的解决方案工程并可正常运行时,VC-LTL就趋于完美可实用阶段了。
1>------ 已启动生成: 项目: i18n, 配置: Release Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(1189,5): warning MSB8012: TargetPath(N:\Open_Code\icu\icu4c\source\i18n.....\lib\i18n.dll) does not match the Linker's OutputFile property value (N:\Open_Code\icu\icu4c\bin\icuin60.dll). This may cause your project to build incorrectly. To correct this, please make sure that
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(1191,5): warning MSB8012: TargetName(i18n) does not match the Linker's OutputFile property value (icuin60). This may cause your project to build incorrectly. To correct this, please make sure that
1> 正在创建库 ....\lib\icuin.lib 和对象 ....\lib\icuin.exp
1>ltl.lib(_msvcrt.obj) : warning LNK4217: 本地定义的符号 __invoke_watson 在函数 __invalid_parameter_noinfo_noreturn 中导入
1>digitlst.obj : error LNK2019: 无法解析的外部符号 __imp___create_locale,该符号在函数 "public: static double __cdecl icu_60::DigitList::decimalStrToDouble(char *,char * *)" (?decimalStrToDouble@DigitList@icu_60@@SANPADPAPAD@Z) 中被引用
1>digitlst.obj : error LNK2019: 无法解析的外部符号 __imp___free_locale,该符号在函数 _digitList_cleanup 中被引用
又有段时间没写c++了,这次回来发现VC-LTL升级到了4.0,同时我自己装的vs2017也升了一堆版本。然后发现自己以前的项目编译不过了。吭哧吭哧把所有用到的三方库全部重新编译了一遍,最后还是编译不过。这项目是我自己写的一个半成品音乐播放器,使用directaudio,然后链接了一堆解码库,这些都不是重点。
然后我慢慢精简代码,精简到最后只有个wtl界面依然通不过。接下来的测试就略过,反正最后就剩下来下面这几行代码。如果去掉atomic的注释,则无法通过编译。
#include <atlbase.h>
#include <atlapp.h>
//#include <atomic>
CAppModule _tModule;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR szCmdLine, int nCmdShow)
{
int ret = 0;
return ret;
}
◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
◆ ◆
◆ * * * * * * * * * * * ◆
◆ * * * * * * ◆
◆ * * * * * * * * * * * ◆
◆ * * * * * * ◆
◆ * * * * * * * * * * * * ◆
◆ ◆
◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆◆
VC-LTL Path : C:\Work\CodeSource\VC-LTL\
VC Tools Version : 14.16.27023
UCRT Version : 10.0.17763.0
Platform : x64
Using VC-LTL Vista Advanced Mode
main.cpp
libcpmt.lib(nothrow.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MT_LTL_StaticRelease”不匹配值“MT_StaticRelease”(main.obj 中)
C:\Users\gbgba\Documents\Visual Studio 2017\Projects\checkwtl\x64\Release\checkwtl.exe : fatal error LNK1319: 检测到 1 个不匹配项
已完成生成项目“checkwtl.vcxproj”的操作 - 失败。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
VC-LTL\ucrt\10.0.16299.0\stdio.h 1442行
signed/unsigned mismatch when complie chromium.
https://github.com/Chuyu-Team/VC-LTL/search?q=LibMaker&unscoped_q=LibMaker
"D:\用户数据\Documents\Visual Studio 2017\Projects\ltlbuild\Debug\LibMaker.exe"
我们已经发现了此兼容性问题,将在未来版本中修正此问题。
之前在某个issue中也提到过。之后发现这里也一直没修改过。后来有段时间不怎么写c++了,这个库也关注少了(js的时代嘛,一言难尽……)。在今天这个无心工作一心只想为祖国母亲庆生的时候,为了打发下班前的漫长时光,还是拿出来交流一下吧。
简单说就是VC-LTL helper for nmake.cmd(包括里面调用的config.cmd)这个文件里面的换行符是\n(0xa),实际上windows的命令行只接受\r\n(0xd0xa)这种换行,如果只有\n的话,它会把下面一行的内容当做同一行的内容,然后各种奇怪的错误就出现了。所以在我本地,这个文件一直都是要手动重新处理过后才能正常用vs的“开发人员命令行”执行的。
这个问题其实应该很容易发现的,但是@mingkuang-Chuyu 一直没有提到,甚至也没有别人提到这个问题。这就很值得探讨了。可以基本上肯定,这个文件在@mingkuang-Chuyu 那里是正常执行的。那么,是不是我们的环境有什么不同呢?
(ps:虽然看我的执行路径是在msys下面,实际上只是因为我用msys做git客户端而已,并不是用msys执行的)
E:\CodeProject\msys2\home\admin\VC-LTL>call "VC-LTL helper for nmake.cmd" '2.' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 '7.' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 '会维持在VS2008。如果你需要高度兼容微软UCRT,那么请不要打开此选项!!!' 不是内部或外部命令,也不是 可运行的程序 或批处理文件。 '件根目录存在VC-LTL?' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 'onfig' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 文件名、目录名或卷标语法不正确。 文件名、目录名或卷标语法不正确。 系统找不到指定的路径。
能否提供在nmake中调用VC-LTL的方式或脚本
1>------ 已启动生成: 项目: common, 配置: Release Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(1189,5): warning MSB8012: TargetPath(N:\Open_Code\icu\icu4c\source\common.....\lib\common.dll) does not match the Linker's OutputFile property value (N:\Open_Code\icu\icu4c\bin\icuuc60.dll). This may cause your project to build incorrectly. To correct this, please make sure that
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(1191,5): warning MSB8012: TargetName(common) does not match the Linker's OutputFile property value (icuuc60). This may cause your project to build incorrectly. To correct this, please make sure that
1>vc2013_crt_misc.obj : 找到 MSIL .netmodule 或使用 /GL 编译的模块;正在使用 /LTCG 重新启动链接;将 /LTCG 添加到链接命令行以改进链接器性能
1> 正在创建库 ....\lib\icuuc.lib 和对象 ....\lib\icuuc.exp
1>std_type_info.obj : error LNK2001: 无法解析的外部符号 __free_base
1>std_type_info.obj : error LNK2001: 无法解析的外部符号 __malloc_base
1>putil.obj : error LNK2001: 无法解析的外部符号 __imp____timezone
1>putil.obj : error LNK2001: 无法解析的外部符号 __imp____tzname
1>putil.obj : error LNK2001: 无法解析的外部符号 __imp____stdio_common_vsprintf
1>uloc.obj : error LNK2001: 无法解析的外部符号 __imp____stdio_common_vsprintf
1>....\bin\icuuc60.dll : fatal error LNK1120: 5 个无法解析的外部命令
1>已完成生成项目“common.vcxproj”的操作 - 失败。
========== 生成: 成功 0 个,失败 1 个,最新 1 个,跳过 0 个 ==========
将近一年前,开发NCleaner的时候发现……有个按格式输出字符串函数由于调用不正确导致应用奔溃
后来换了另一个函数实现,就没再出问题
vs2015。toolset选择xp。在win7运行正常。xp弹这个错误。
环境:Win10 Pro x64 + VS2015
我已经安装了KB3165756,在About里能看到版本号是14.0.25431.01 Update 3。
我看了一下ltlvcrt.props代码,里面确定版本的方法是查找{4B1849F2-3D49-325F-B997-4AD0BF5B8A09}这一条记录,但是我在注册表里没有这一条。
quick_eixt
应改为 quick_exit
描述
前端 Clang 6.0.1,后端 VS2017 15.8.2,编译 Qt 5.11.1,出现以下错误:
sqlite3.obj : error LNK2001: 无法解析的外部符号 __byteswap_ulong
sqlite3.obj : error LNK2001: 无法解析的外部符号 __byteswap_ushort
sqlite3.obj : error LNK2001: 无法解析的外部符号 __byteswap_uint64
环境信息
error LNK2001: unresolved external symbol __imp___ftelli64
在编译luajit的x64版本时候报错。
link /nologo /DLL /out:lua51.dll lj_.obj lib_.obj
正在创建库 lua51.lib 和对象 lua51.exp
lj_clib.obj : error LNK2019: 无法解析的外部符号 __imp___p__fmode,该符号在函数 clib_getsym 中被引用
使用的是luajit2.0.5,已经在msvcbuild.bat文件中手动改为MD模式
@set LJCOMPILE=cl /MD /nologo /c /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_STDIO_INLINE=__declspec(dllexport)__inline
例如wcslen会跑飞。cdecl和stdcall没问题
VC Tools Version : 14.15.26726
UCRT Version : 10.0.10240.0
Platform : x86
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.