XP的兼容性考虑

31 篇文章 0 订阅
13 篇文章 0 订阅

前言

windows xp正在慢慢退出历史舞台,但是目前还没退出。还有大量的xp系统存活着。为了兼容它们,费了不少功夫,值得一说。

正文

Qt

Qt的xp支持分两个部分,根据不同的编译器,来进行不同的处理

vs编译器

需要在pro文件中加上

#QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
#QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
#DEFINES += _ATL_XP_TARGETING

不加的话,会报”不是windows程序”的错误。
参考0

mingw编译器

默认已经支持xp了。
但是你不能使用一些函数例如:strcat_s。strcat是可以的。我猜测凡是带”_s”都不可以。

ffmpeg

跑在xp系统上,会报”getnumanodeprocessormaskex”在kernel.dll中找不到错误。
参考1
参考2
需要下载一个软件,把dll里面的链接修改了一下。
我看到这里

FT ft[]={
{"_wfopen_s",                    "_wfopen"},
{"strncpy_s",                    "strncpy"},
{"swscanf_s",                    "swscanf"},
{"strtok_s",                     "strtok"},
{"GetNumaNodeProcessorMaskEx",   "GetNumaNodeProcessorMask"},
{"InitializeConditionVariable",  "InitializeCriticalSection"},
{"SetThreadGroupAffinity",       "SetThreadAffinityMask"},
{"SleepConditionVariableCS",     "LeaveCriticalSection"},
{"WakeAllConditionVariable",     "EnterCriticalSection"},
};

它的作用貌似是把调用的库改了一下。以此类推,当其他的库应该也可以这么处理一下,就兼容xp了。
不过我感觉而这种方式有点危险。

补充

mysys2已经放弃支持xp了,竟然装不上。
chrome浏览器也放弃支持了。

总结

如果有可能,劝说客户放弃xp系统。

Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... Getting help: -h -- print basic options -h long -- print more options -h full -- print all options (including all format and codec specific options, very long) See man ffmpeg for detailed description of the options. Print help / information / capabilities: -L show license -h topic show help -? topic show help -help topic show help --help topic show help -version show version -buildconf show build configuration -formats show available formats -devices show available devices -codecs show available codecs -decoders show available decoders -encoders show available encoders -bsfs show available bit stream filters -protocols show available protocols -filters show available filters -pix_fmts show available pixel formats -layouts show standard channel layouts -sample_fmts show available audio sample formats -colors show available color names -sources device list sources of the input device -sinks device list sinks of the output device Global options (affect whole program instead of just one file: -loglevel loglevel set logging level -v loglevel set logging level -report generate a report -max_alloc bytes set maximum size of a single allocated block -y overwrite output files -n never overwrite output files -stats print progress report during encoding -max_error_rate ratio of errors (0.0: no errors, 1.0: 100% error maximum error rate -bits_per_raw_sample number set the number of bits per raw sample -vol volume change audio volume (256=normal) Per-file main options: -f fmt force format -c codec codec name -codec codec
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值