﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-</title><link>http://www.cppblog.com/hkingSP/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 05 Apr 2026 13:09:14 GMT</lastBuildDate><pubDate>Sun, 05 Apr 2026 13:09:14 GMT</pubDate><ttl>60</ttl><item><title>git rebase 到更新的master</title><link>http://www.cppblog.com/hkingSP/archive/2021/04/02/217650.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Fri, 02 Apr 2021 06:33:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2021/04/02/217650.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/217650.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2021/04/02/217650.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/217650.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/217650.html</trackback:ping><description><![CDATA[<div>1. Assume the following history exists and the current branch is "topic":</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A---B---C topic</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/</div><div>&nbsp;D---E---F---G master</div><div></div><div><br />From this point, the result of either of the following commands:</div><div></div><div>git rebase master</div><div>git rebase master topic</div><div></div><div><br />would be:</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;A'--B'--C' topic</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /</div><div>&nbsp;D---E---F---G master<br /><br />2. git rebase 过程中：<br />在修改完需要merge的文件后，用git add和git status来确认rebase状态，然后再git rebase --continue&nbsp;</div><img src ="http://www.cppblog.com/hkingSP/aggbug/217650.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2021-04-02 14:33 <a href="http://www.cppblog.com/hkingSP/archive/2021/04/02/217650.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>git tag and git describe a specified path/commits/tags</title><link>http://www.cppblog.com/hkingSP/archive/2021/01/13/217569.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Wed, 13 Jan 2021 02:40:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2021/01/13/217569.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/217569.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2021/01/13/217569.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/217569.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/217569.html</trackback:ping><description><![CDATA[<div>1.&nbsp;Create a tag with patterned name</div><div>git tag "tagname_v1.02"</div><div>(one tag is pointed to a specified commit)<br /></div><div>2. get tag describe to use in software version name</div><div>git describe --tags --long --dirty=* --match "tagname*"</div><div>&gt; tagname_v1.02-0-g59584af<br /><br />3. push tag name to remote repo</div><div>git push origin &lt;branchname&gt; --tags<br /></div><img src ="http://www.cppblog.com/hkingSP/aggbug/217569.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2021-01-13 10:40 <a href="http://www.cppblog.com/hkingSP/archive/2021/01/13/217569.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>unix/windows回车问题(\r\n or \n) or shell脚本执行错误 $'\r':command not found</title><link>http://www.cppblog.com/hkingSP/archive/2019/10/25/216956.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Fri, 25 Oct 2019 02:41:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/10/25/216956.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216956.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/10/25/216956.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216956.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216956.html</trackback:ping><description><![CDATA[<div>unix/windows回车问题</div><div>shell脚本执行错误 $'\r':command not found<br />存现这种错误是因为 编写的&nbsp; shell脚本是在win下编写的，每行结尾是\r\n 的Unix 结果行是\n&nbsp;&nbsp;<br />所以在Linux下运行脚本 会任务\r 是一个字符，所以运行错误，需要把文件转换下。</div><div>1.单个文件转换：</div><div>运行脚本&nbsp;</div><div>&nbsp;dos2unix&nbsp; 脚本名</div><div>OK</div><div>2.整个目录中的文件做dos2unix操作:</div><div>$ find . -type f -exec dos2unix {} \;</div><div>其中具体命令的解释如下：</div><div>find .</div><div>= find files in the current directory</div><div>-type f</div><div>= of type f</div><div>-exec dos2unix {} \;</div><div>= and execute dos2unix on each file found<br /><br />参考：<br /><a href="https://blog.csdn.net/Lnho2015/article/details/51322289">https://blog.csdn.net/Lnho2015/article/details/51322289<br /><a href="https://blog.csdn.net/yuliying/article/details/75912021">https://blog.csdn.net/yuliying/article/details/75912021</a><br /><a href="https://blog.csdn.net/liuxiangke0210/article/details/80395707">https://blog.csdn.net/liuxiangke0210/article/details/80395707</a><br /><br /></a></div><img src ="http://www.cppblog.com/hkingSP/aggbug/216956.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-10-25 10:41 <a href="http://www.cppblog.com/hkingSP/archive/2019/10/25/216956.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>编译 linux kernel package .ko</title><link>http://www.cppblog.com/hkingSP/archive/2019/10/10/216905.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Thu, 10 Oct 2019 02:50:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/10/10/216905.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216905.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/10/10/216905.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216905.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216905.html</trackback:ping><description><![CDATA[<pre style="white-space: pre-wrap;">工具和代码准备：
sudo&nbsp;apt-get&nbsp;install&nbsp;build-essential&nbsp;linux-source&nbsp;bc&nbsp;kmod&nbsp;cpio&nbsp;flex&nbsp;cpio&nbsp;libncurses5-dev<br />Full source:    <a rel="nofollow" href="https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.167.tar.xz">https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.4.167.tar.xz<br />t</a>ar xvf linux-4.4.167.tar.xz
检查架构：
<div>dpkg --print-architecture</div>内核配置，
<strong>使用arch/arm64/configs/defconfig下面的默认配置进行编译</strong>：<br />make ARCH=arm64&nbsp;defconfig
<strong>`make oldconfig` reads the .config file in the current directory and prompts you about any new changes to the kernel:</strong><br />make oldconfig&amp;&amp;make prepare&amp;&amp;make scripts
ko代码编译：<br /><div>make 4_4_167_smp_x64<br />检查version magic：
modinfo bizwsd.ko</div>
</pre><img src ="http://www.cppblog.com/hkingSP/aggbug/216905.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-10-10 10:50 <a href="http://www.cppblog.com/hkingSP/archive/2019/10/10/216905.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>vi 初始设置，切换到非兼容模式，防止上下右左 变成 ABCD</title><link>http://www.cppblog.com/hkingSP/archive/2019/09/06/216778.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Fri, 06 Sep 2019 01:40:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/09/06/216778.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216778.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/09/06/216778.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216778.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216778.html</trackback:ping><description><![CDATA[<p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; color: #242729; background-color: #ffffff;">If you don't already have a&nbsp;<code style="margin: 0px; padding: 1px 5px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: #eff0f1; white-space: pre-wrap;">.vimrc</code>&nbsp;file in your home directory, create one using this:</p><pre style="margin-top: 0px; margin-bottom: 1em; padding: 12px 8px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; background-color: #eff0f1; border-radius: 3px; overflow-wrap: normal; color: #242729;"><code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">vim ~/.vimrc </code></pre><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; color: #242729; background-color: #ffffff;">Add this line to the top of the file:</p><pre style="margin-top: 0px; margin-bottom: 1em; padding: 12px 8px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; background-color: #eff0f1; border-radius: 3px; overflow-wrap: normal; color: #242729;"><code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, &quot;Lucida Console&quot;, &quot;Liberation Mono&quot;, &quot;DejaVu Sans Mono&quot;, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">set nocompatible </code></pre><p style="margin: 0px 0px 1em; padding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: Arial, &quot;Helvetica Neue&quot;, Helvetica, sans-serif; font-size: 15px; vertical-align: baseline; box-sizing: inherit; clear: both; color: #242729; background-color: #ffffff;">Save the file and this should fix the problem for you. :)<br /><br />解释 何为兼容模式：<br />初装linux，vi 启动的时候，会运行在兼容模式，此兼容模式是兼容old vi，所以会有这种情况。<br />此模式下，所有vi后来的改进都是关闭的。<br /><br /><br /></p><img src ="http://www.cppblog.com/hkingSP/aggbug/216778.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-09-06 09:40 <a href="http://www.cppblog.com/hkingSP/archive/2019/09/06/216778.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>cl command</title><link>http://www.cppblog.com/hkingSP/archive/2019/03/09/216292.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Sat, 09 Mar 2019 03:23:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/03/09/216292.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216292.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/03/09/216292.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216292.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216292.html</trackback:ping><description><![CDATA[<div>搞懂编译过程 编译器都在干嘛<br /><div>cl -I 包含需要的目录，其命令的结尾往往是一个.c或.cpp文件。<br />cl命令出错，一般是无法找到需要的头文件。</div><br />附录：cl -help<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;C/C++ COMPILER OPTIONS</div><div></div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -OPTIMIZATION-</div><div></div><div>/O1 minimize space&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /O2 maximize speed</div><div>/Ob&lt;n&gt; inline expansion (default n=0)&nbsp; &nbsp;/Od disable optimizations (default)</div><div>/Og enable global optimization&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /Oi[-] enable intrinsic functions</div><div>/Os favor code space&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /Ot favor code speed</div><div>/Ox maximum optimizations&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/Oy[-] enable frame pointer omission&nbsp;</div><div>/favor:&lt;blend|ATOM&gt; select processor to optimize for, one of:</div><div>&nbsp; &nbsp; blend - a combination of optimizations for several different x86 processors</div><div>&nbsp; &nbsp; ATOM - Intel(R) Atom(TM) processors&nbsp;</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-CODE GENERATION-</div><div></div><div>/Gw[-] separate global variables for linker</div><div>/GF enable read-only string pooling&nbsp; &nbsp; &nbsp;/Gm[-] enable minimal rebuild</div><div>/Gy[-] separate functions for linker&nbsp; &nbsp; /GS[-] enable security checks</div><div>/GR[-] enable C++ RTTI&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /GX[-] enable C++ EH (same as /EHsc)</div><div>/guard:cf[-] enable CFG (control flow guard)</div><div>/EHs enable C++ EH (no SEH exceptions)&nbsp; /EHa enable C++ EH (w/ SEH exceptions)</div><div>/EHc extern "C" defaults to nothrow&nbsp; &nbsp; &nbsp;</div><div>/EHr always generate noexcept runtime termination checks</div><div>/fp:&lt;except[-]|fast|precise|strict&gt; choose floating-point model:</div><div>&nbsp; &nbsp; except[-] - consider floating-point exceptions when generating code</div><div>&nbsp; &nbsp; fast - "fast" floating-point model; results are less predictable</div><div>&nbsp; &nbsp; precise - "precise" floating-point model; results are predictable</div><div>&nbsp; &nbsp; strict - "strict" floating-point model (implies /fp:except)</div><div>/Qfast_transcendentals generate inline FP intrinsics even with /fp:except</div><div>/Qpar[-] enable parallel code generation</div><div>/Qpar-report:1 auto-parallelizer diagnostic; indicate parallelized loops</div><div>/Qpar-report:2 auto-parallelizer diagnostic; indicate loops not parallelized</div><div>/Qvec-report:1 auto-vectorizer diagnostic; indicate vectorized loops</div><div>/Qvec-report:2 auto-vectorizer diagnostic; indicate loops not vectorized</div><div>/GL[-] enable link-time code generation&nbsp;</div><div>/volatile:&lt;iso|ms&gt; choose volatile model:</div><div>&nbsp; &nbsp; iso - Acquire/release semantics not guaranteed on volatile accesses</div><div>&nbsp; &nbsp; ms&nbsp; - Acquire/release semantics guaranteed on volatile accesses</div><div>/GA optimize for Windows Application&nbsp; &nbsp; /Ge force stack checking for all funcs</div><div>/Gs[num] control stack checking calls&nbsp; &nbsp;/Gh enable _penter function call</div><div>/GH enable _pexit function call&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/GT generate fiber-safe TLS accesses</div><div>/RTC1 Enable fast checks (/RTCsu)&nbsp; &nbsp; &nbsp; &nbsp;/RTCc Convert to smaller type checks</div><div>/RTCs Stack Frame runtime checking&nbsp; &nbsp; &nbsp; /RTCu Uninitialized local usage checks</div><div>/clr[:option] compile for common language runtime, where option is:</div><div>&nbsp; &nbsp; pure - produce IL-only output file (no native executable code)</div><div>&nbsp; &nbsp; safe - produce IL-only verifiable output file</div><div>&nbsp; &nbsp; initialAppDomain - enable initial AppDomain behavior of Visual C++ 2002</div><div>&nbsp; &nbsp; noAssembly - do not produce an assembly</div><div>&nbsp; &nbsp; nostdlib - ignore the default \clr directory</div><div>/Gd __cdecl calling convention&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /Gr __fastcall calling convention</div><div>/Gz __stdcall calling convention&nbsp; &nbsp; &nbsp; &nbsp; /GZ Enable stack checks (/RTCs)</div><div>/Gv __vectorcall calling convention&nbsp; &nbsp; &nbsp;/QIfist[-] use FIST instead of ftol()</div><div>/hotpatch ensure function padding for hotpatchable images</div><div>/arch:&lt;IA32|SSE|SSE2|AVX|AVX2&gt; minimum CPU architecture requirements, one of:</div><div>&nbsp; &nbsp;IA32 - use no enhanced instructions and use x87 for floating point</div><div>&nbsp; &nbsp;SSE - enable use of instructions available with SSE-enabled CPUs</div><div>&nbsp; &nbsp;SSE2 - (default) enable use of instructions available with SSE2-enabled CPUs</div><div>&nbsp; &nbsp;AVX - enable use of instructions available with AVX-enabled CPUs</div><div>&nbsp; &nbsp;AVX2 - enable use of instructions available with AVX2-enabled CPUs</div><div>/Qimprecise_fwaits generate FWAITs only on "try" boundaries, not inside "try"</div><div>/Qsafe_fp_loads generate safe FP loads&nbsp;&nbsp;</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -OUTPUT FILES-</div><div></div><div>/Fa[file] name assembly listing file&nbsp; &nbsp; /FA[scu] configure assembly listing</div><div>/Fd[file] name .PDB file&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /Fe&lt;file&gt; name executable file</div><div>/Fm[file] name map file&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/Fo&lt;file&gt; name object file</div><div>/Fp&lt;file&gt; name precompiled header file&nbsp; /Fr[file] name source browser file</div><div>/FR[file] name extended .SBR file&nbsp; &nbsp; &nbsp; &nbsp;/Fi[file] name preprocessed file</div><div>/Fd: &lt;file&gt; name .PDB file&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /Fe: &lt;file&gt; name executable file</div><div>/Fm: &lt;file&gt; name map file&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/Fo: &lt;file&gt; name object file</div><div>/Fp: &lt;file&gt; name .PCH file&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /FR: &lt;file&gt; name extended .SBR file</div><div>/Fi: &lt;file&gt; name preprocessed file&nbsp; &nbsp; &nbsp;&nbsp;</div><div>/doc[file] process XML documentation comments and optionally name the .xdc file</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -PREPROCESSOR-</div><div></div><div>/AI&lt;dir&gt; add to assembly search path&nbsp; &nbsp; /FU&lt;file&gt; forced using assembly/module&nbsp;</div><div>/C don't strip comments&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/D&lt;name&gt;{=|#}&lt;text&gt; define macro</div><div>/E preprocess to stdout&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/EP preprocess to stdout, no #line</div><div>/P preprocess to file&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/Fx merge injected code to file</div><div>/FI&lt;file&gt; name forced include file&nbsp; &nbsp; &nbsp; /U&lt;name&gt; remove predefined macro</div><div>/u remove all predefined macros&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/I&lt;dir&gt; add to include search path</div><div>/X ignore "standard places"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -LANGUAGE-</div><div></div><div>/Zi enable debugging information&nbsp; &nbsp; &nbsp; &nbsp; /Z7 enable old-style debug info</div><div>/Zp[n] pack structs on n-byte boundary&nbsp; /Za disable extensions</div><div>/Ze enable extensions (default)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/Zl omit default library name in .OBJ</div><div>/Zs syntax check only&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/vd{0|1|2} disable/enable vtordisp</div><div>/vm&lt;x&gt; type of pointers to members&nbsp; &nbsp; &nbsp;&nbsp;</div><div>/Zc:arg1[,arg2] C++ language conformance, where arguments can be:</div><div>&nbsp; forScope[-]&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enforce Standard C++ for scoping rules</div><div>&nbsp; wchar_t[-]&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wchar_t is the native type, not a typedef</div><div>&nbsp; auto[-]&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enforce the new Standard C++ meaning for auto</div><div>&nbsp; trigraphs[-]&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enable trigraphs (off by default)</div><div>&nbsp; rvalueCast[-]&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;enforce Standard C++ explicit type conversion rules</div><div>&nbsp; strictStrings[-]&nbsp; &nbsp; &nbsp; disable string-literal to [char|wchar_t]*</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conversion (off by default)</div><div>&nbsp; implicitNoexcept[-]&nbsp; &nbsp;enable implicit noexcept on required functions</div><div>&nbsp; threadSafeInit[-]&nbsp; &nbsp; &nbsp;enable thread-safe local static initialization</div><div>&nbsp; inline[-]&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;remove unreferenced function or data if it is</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COMDAT or has internal linkage only (off by default)</div><div>&nbsp; sizedDealloc[-]&nbsp; &nbsp; &nbsp; &nbsp;enable C++14 global sized deallocation</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; functions (on by default)</div><div>&nbsp; throwingNew[-]&nbsp; &nbsp; &nbsp; &nbsp; assume operator new throws on failure (off by default)</div><div>&nbsp; referenceBinding[-]&nbsp; &nbsp;a temporary will not bind to an non-const</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lvalue reference (off by default)</div><div>/ZH:SHA_256&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use SHA256 for file checksum in debug info (experimental)</div><div></div><div>/Zo[-] generate richer debugging information for optimized code (on by default)</div><div>/ZW enable WinRT language extensions&nbsp; &nbsp;&nbsp;</div><div>/constexpr:depth&lt;N&gt;&nbsp; &nbsp; &nbsp;use &lt;N&gt; as the recursion depth limit</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for constexpr (default: 512)</div><div>/constexpr:backtrace&lt;N&gt; show &lt;N&gt; constexpr evaluations</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in diagnostics (default: 10)</div><div>/constexpr:steps&lt;N&gt;&nbsp; &nbsp; &nbsp;terminate constexpr evaluation after</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;N&gt; steps (default: 100000)</div><div>/ZI enable Edit and Continue debug info&nbsp;</div><div>/openmp enable OpenMP 2.0 language extensions</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -MISCELLANEOUS-</div><div></div><div>@&lt;file&gt; options response file&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/?, /help print this help message</div><div>/bigobj generate extended object format /c compile only, no link</div><div>/errorReport:option Report internal compiler errors to Microsoft</div><div>&nbsp; &nbsp; none - do not send report&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; prompt - prompt to immediately send report</div><div>&nbsp; &nbsp; queue - at next admin logon, prompt to send report (default)</div><div>&nbsp; &nbsp; send - send report automatically&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>/FC use full pathnames in diagnostics&nbsp; &nbsp;/H&lt;num&gt; max external name length</div><div>/J default char type is unsigned&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>/MP[n] use up to 'n' processes for compilation</div><div>/nologo suppress copyright message&nbsp; &nbsp; &nbsp;&nbsp;</div><div>/sdl enable additional security features and warnings</div><div>/showIncludes show include file names&nbsp; &nbsp;/Tc&lt;source file&gt; compile file as .c</div><div>/Tp&lt;source file&gt; compile file as .cpp&nbsp; &nbsp;/TC compile all files as .c</div><div>/TP compile all files as .cpp&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/V&lt;string&gt; set version string</div><div>/w disable all warnings&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/wd&lt;n&gt; disable warning n</div><div>/we&lt;n&gt; treat warning n as an error&nbsp; &nbsp; &nbsp; /wo&lt;n&gt; issue warning n once</div><div>/w&lt;l&gt;&lt;n&gt; set warning level 1-4 for n&nbsp; &nbsp; /W&lt;n&gt; set warning level (default n=1)</div><div>/Wall enable all warnings&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/WL enable one line diagnostics</div><div>/WX treat warnings as errors&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /Yc[file] create .PCH file</div><div>/Yd put debug info in every .OBJ&nbsp; &nbsp; &nbsp; &nbsp; /Yl[sym] inject .PCH ref for debug lib</div><div>/Yu[file] use .PCH file&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/Y- disable all PCH options</div><div>/Zm&lt;n&gt; max memory alloc (% of default)&nbsp; /FS force to use MSPDBSRV.EXE</div><div>/await enable resumable functions extension</div><div>/Wv:xx[.yy[.zzzzz]] disable warnings introduced after version xx.yy.zzzzz</div><div>/source-charset:&lt;iana-name&gt;|.nnnn set source character set</div><div>/execution-charset:&lt;iana-name&gt;|.nnnn set execution character set</div><div>/utf-8 set source and execution character set to UTF-8</div><div>/validate-charset[-] validate UTF-8 files for only legal characters</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -LINKING-</div><div></div><div>/LD Create .DLL&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/LDd Create .DLL debug library</div><div>/LN Create a .netmodule&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/F&lt;num&gt; set stack size</div><div>/link [linker options and libraries]&nbsp; &nbsp; /MD link with MSVCRT.LIB</div><div>/MT link with LIBCMT.LIB&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /MDd link with MSVCRTD.LIB debug lib</div><div>/MTd link with LIBCMTD.LIB debug lib&nbsp; &nbsp;&nbsp;</div><div></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CODE ANALYSIS-</div><div></div><div>/analyze[-] Enable native analysis&nbsp; &nbsp; &nbsp; /analyze:quiet[-] No warning to console</div><div>/analyze:log&lt;name&gt; Warnings to file&nbsp; &nbsp; &nbsp;/analyze:autolog Log to *.pftlog</div><div>/analyze:autolog:ext&lt;ext&gt; Log to *.&lt;ext&gt;/analyze:autolog- No log file</div><div>/analyze:WX- Warnings not fatal&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/analyze:stacksize&lt;num&gt; Max stack frame</div><div>/analyze:max_paths&lt;num&gt; Max paths&nbsp; &nbsp; &nbsp; &nbsp;/analyze:only Analyze, no code gen</div><div></div><img src ="http://www.cppblog.com/hkingSP/aggbug/216292.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-03-09 11:23 <a href="http://www.cppblog.com/hkingSP/archive/2019/03/09/216292.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>QT_VS2005_CE6.0_开发环境架设</title><link>http://www.cppblog.com/hkingSP/archive/2019/03/08/216291.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Fri, 08 Mar 2019 06:30:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/03/08/216291.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216291.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/03/08/216291.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216291.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216291.html</trackback:ping><description><![CDATA[<div><p>《QT_VS2005_CE6.0_开发环境架设》<br />1、基础环境：<br />操作系统：Windows XP<br />编译器：（1）VS2005 VC环境  （2）VS2005 SP1<br />（SP1 必须有，以提供CE平台的支持，没有的话，Arm  Emulator的程序编译不过，模拟器也报错&#8220;EmulatorStub.exe严重错误&#8221;）<br />QT版本：qt-everywhere-opensource-src-4.8.6.zip<br />CE  SDK：ARM  Emulator<br /><br />2、安装步骤：<br />（1）把QT源码解压到E:\QT\4.8.6\CE6.0\Emulator<br />Tim：个人推荐根目录，不带任何下划线、空格等幺蛾子，防止出错。。<br />Tim：<u>绝对不能带下划线</u>：<br />公司电脑上的目录，起名带个下划线"4.8.6_ArmEmulator"，结果VS2005创建工程失败，说缺少平台支持。。<br />Tim：也最好位于C盘，我把家里电脑的编译版本，放到公司电脑的C盘，创建项目成功，原来的公司版本在E盘，会失败。。不知道是不是错觉。。<br />（2）进入&#8220;Visual  Studio 2005 命令提示&#8221;<br />位置是&#8220;开始菜单-&gt;所有程序-&gt;Microsoft Visual Studio  2005-&gt;Visual Studio Tools-&gt;Visual Studio 2005  命令提示&#8221;。。<br />然后切换到编译目录：E:\QT\4.8.6\CE6.0\Emulator<br />（3）执行以下命令：<br />configure  -platform win32-msvc2005 -xplatform  wince60standard-armv4i-msvc2005<br />&#9312;如果想节省时间，部分编译：<br />[-debug-and-release]  编译和链接两个版本的Qt<br />[-nomake examples]<br />[-nomake demos]<br />[-nomake  docs]<br />[-no-multimedia] <br />[-no-phonon]  <br />[-no-phonon-backend]&nbsp;<br />[-no-media-backend]  <br />[-no-audio-backend]&nbsp;<br />[-no-openssl]<br />[-no-gtkstyle] <br />[-no-svg]  <br />[-no-webkit]&nbsp;  是否编译Web相关的一些QT子库，加上这个可以省不少编译时间，就看你是否准备用这些库了。<br />[-no-javascript-jit]&nbsp;<br />[-no-script]<br />[-no-scripttools]&nbsp;<br />[-no-sql-sqlite]<br />[-no-declarative]<br />[-no-declarative-debug]  <br />Tim：以上可选项均未试验。。 <br />Tim：<br />又抄来一个编译WIN32 VS2005设置的：<br />configure -fast  -platform win32-msvc2005&nbsp; -nomake examples -nomake docs -nomake demos -no-webkit  -no-phonon -no-phonon-backend  -no-multimedia<br />Tim：<br />4.8.6版的，不管怎么编译，都会出错。。<br />&#9312;第一个错误，修改如下：<br />qclipboard_win.cpp  第306行：<br />把出错的CheckRemoteDebuggerPresent，通过版本判断的方式，不编译进来。。<br />#if  defined(_MSC_VER) &amp;&amp; _MSC_VER &lt;= 1400<br />&nbsp;&nbsp;&nbsp; return  false;<br />#else<br />........................<br />&nbsp;&nbsp;&nbsp;  CheckRemoteDebuggerPresent(processHandle,  &amp;debugged);<br />#endif<br />&#9313;第二个错误：<br />继续 nmake　遇到第二个错误<br />&nbsp;&nbsp;&nbsp;&nbsp;  platform\DefaultLocalizationStrategy.cpp(327) : error C2001: newline in  constant<br />&nbsp;&nbsp;&nbsp;&nbsp; platform\DefaultLocalizationStrategy.cpp(327) : fatal error  C1057: unexpected end of file in macro expansion<br />&nbsp;&nbsp;&nbsp;&nbsp;  这个错误的原因是因为代码里面的非英文的引号造成的。<br />&nbsp;&nbsp;&nbsp; 原始的错误代码如下：<br />&nbsp;&nbsp;&nbsp;&nbsp; return WEB_UI_STRING("Look  Up &#8220;&lt;selection&gt;&#8221;", "Look Up context menu item with selected  word").replace("&lt;selection&gt;",  truncatedStringForLookupMenuItem(selectedString));<br />&nbsp;&nbsp;&nbsp;&nbsp;  大家注意　&lt;selection&gt; 单词前后的引号。就是它造成编译报错。修改成下面的代码<br />&nbsp;&nbsp;&nbsp; return  WEB_UI_STRING("Look Up \"&lt;selection&gt;\"", "Look Up context menu item with  selected word").replace("&lt;selection&gt;",  truncatedStringForLookupMenuItem(selectedString));<br />Tim：也就是将selection两侧的中文引号那里改成上文的样子，。。奇怪老外也用这种引号么。。<br />（4）configure之后设置环境变量：<br />&#9312;使用Arm  Emulator：<br />set INCLUDE=C:/Program Files/Microsoft Visual Studio  8/VC/ce/include;C:\Program Files\Windows CE  Tools\wce600\ARM_Emulator\Include\Armv4i<br />set LIB=C:/Program Files/Microsoft  Visual Studio 8/VC/ce/lib/armv4i;C:/Program Files/Windows CE  Tools/wce600/ARM_Emulator/Lib/armv4i<br />set PATH=C:/Program Files/Microsoft  Visual Studio 8/VC/ce/bin/x86_arm;%PATH%<br />&#9313;如果使用S2416的SDK：<br />set  INCLUDE=C:/Program Files/Microsoft Visual Studio 8/VC/ce/include;C:\Program  Files\Windows CE Tools\wce600\SBC2416\Include\Armv4i<br />set LIB=C:/Program  Files/Microsoft Visual Studio 8/VC/ce/lib/armv4i;C:/Program Files/Windows CE  Tools/wce600/SBC2416/Lib/armv4i<br />set PATH=C:/Program Files/Microsoft Visual  Studio  8/VC/ce/bin/x86_arm;%PATH%<br />执行：<br />nmake<br />Tim：我下载的源码4.8.6在configure之后，出现让直行：setcepaths.bat  wince600standard-armv4i-msvc2005 &amp;&amp;  nmake的提示，我估计不用设置上述环境变量，也有可能可以成功编译，但不冒那个险，直接按照文章推荐的步骤来。。<br />Tim：我运行setcepaths.bat，结果没有那个SDK只有wincewm60standard-armv4i-msvc2005，而且那个BAT里面，只是运行了check  sdk的动作。。所以结论是按照推荐文章指定SDK的路径，nmake应该就可以。。<br />Tim：用作者的方案，Nmake编译成功。。<br />（5）安装qt-vs-addin：<br />安装&#8220;qt-vs-addin-1.1.10.exe&#8221;。。<br />Tim：&#8220;qt-vs-addin-1.2.0-opensource.exe  ，就开始不支持VS2005。。&#8221;无语。。<br />（6）修改SDK的名称：<br />编辑"  C:\QT\CE6.0\4.8.6\mkspecs\wince60standard-armv4i-msvc2005\qmake.conf  "。。<br />将里面的<br />CE_SDK&nbsp;&nbsp;= STANDARDSDK_600<br />变更为<br />CE_SDK&nbsp;&nbsp;=  ARM_Emulator<br />Tim：因为原始编译的SDK环境，它名称叫做"wince600standard-armv4i-msvc2005"，Arm  Emulator的库跟这个环境也是一样的，但是名称不一样，Qt插件会报错。。<br />（7）包含环境变量：<br />&#9312;Arm_Emulator的话：<br />在VS2005  -&gt; Tool -&gt; Options -&gt; VC++ Directories -&gt;  Arm_Emulator里面：<br />Include增加：" C:\QT\4.8.6\CE6.0\Emulator\include  "。。<br />Library增加：" C:\QT\4.8.6\CE6.0\Emulator\lib "  。。<br />Tim：我一开始就没包含，结果编译别人的代码，报错没有" QtSql "。。<br />&#9313;WIN32编译的话：<br />在VS2005 -&gt;  Tool -&gt; Options -&gt; VC++ Directories -&gt; Win32里面：<br />Include增加："  C:\QT\4.8.6\WIN32\include "。。<br />Library增加：" C:\QT\4.8.6\WIN32\lib "  。。<br />Tim：<br />为了让Visual  Assist更好的识别QT的函数名、类名，最好在VS2005里面多添加一些目录如：<br />C:\QT\4.8.6\WIN32\src<br />C:\QT\4.8.6\WIN32\include\Qt<br />C:\QT\4.8.6\WIN32\include\QtCore<br />C:\QT\4.8.6\WIN32\include\QtGui<br />（8）开启Arm  Emulator：<br />Tool -&gt; Connect to Device -&gt; Arm Emulator  Device。。<br />（9）新建一个QT工程，编译、运行：<br />开启VS2005 -&gt; File -&gt; New -&gt; Project  -&gt; Qt4 Projects -&gt; Qt Window CE Application -&gt;  都选默认设置，然后编译、部署、执行，最后成功在Arm  Emulator里面弹出个对话框来（OK）。。<br />Tim：看到部署的时候，用了VS2005的库（msvcr80d.dll），还有QT的两三个库（QtCored4.dll、QtGuid4.dll什么的）。。<br />（10）编辑*.ui文件，设计界面：<br />安装"  qt-creator-opensource-windows-x86-3.3.0.exe "，才能打开" *.ui  "文件，从而变更界面。。<br />Tim：看了下.ui文件其实是一个xml结构的文档。。<br />Tim：<br />"  qt-creator-opensource-windows-x86-3.0.0.exe " Based on Qt5.2.0 (&nbsp;MSVC2010,32  bit&nbsp;)。。<br />" qt-creator-opensource-windows-x86-3.3.0.exe " Based on Qt5.4.0  (&nbsp;MSVC2010,32 bit&nbsp;)。。。。<br /><br /><br /><br /><br /><br /><br /><br /></p></div><img src ="http://www.cppblog.com/hkingSP/aggbug/216291.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-03-08 14:30 <a href="http://www.cppblog.com/hkingSP/archive/2019/03/08/216291.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Qt5.10.1 static compiling on Windows MSVC/Ubuntu g++</title><link>http://www.cppblog.com/hkingSP/archive/2019/03/08/216289.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Fri, 08 Mar 2019 03:00:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/03/08/216289.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216289.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/03/08/216289.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216289.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216289.html</trackback:ping><description><![CDATA[<h3>环境：Windows10 / vs2013 or vs2015（Qt5.10.1是以C++11为基础，因此vs2008歇菜了）</h3>参考代码里的Readme：<br /><br /><strong>1.安装：</strong><br />安装了perl/python2.7/ruby&nbsp;<br />安装了vs2015<br /><br /><strong>2.环境变量</strong><br /><div>add C:\Perl\bin to PERL_HOME<br />add %PERL_HOME% to path<br />add C:\Python27 to PYTHON_HOME<br />add %PYTHON_HOME% to path<br />add C:\Ruby26\bin to RUBY_HOME<br />add %RUBY_HOME% to path<br />add C:\Qt\Qt5.10.1\5.10.1\msvc2015\bin to QT_LIB_HOME<br />add %QT_LIB_HOME% to path<br />add C:\Qt\Qt5.10.1\Tools\QtCreator\bin to QT_CREATOR_HOME<br />add %QT_CREATOR_HOME% to path<br />注意：像官方推荐的一样，这里最好用同一版本的binary安装的Qt比较安装。<br />注意：如果这里没有添加QT的路径，就会被推荐用nmake编译，否则被推荐用jom编译。</div><strong>3.代码：</strong><br />代码解压缩到C:\Qt\Qt5.10.1_src<br />于是Configure文件在：<br />C:\Qt\Qt5.10.1_src<br /><br />qtbase文件夹在：<br /><div>C:\Qt\Qt5.10.1_src\qtbase<br /><br /><strong>4.修改配置从MD到MT（动态链接改为静态链接）：</strong><br /><div>修改文件：<br />C:\Qt\Qt5.10.1_src\qtbase\mkspecs\common\msvc-desktop.conf<br />修改下面几行代码：</div><div>QMAKE_CFLAGS_RELEASE&nbsp; &nbsp; = $$QMAKE_CFLAGS_OPTIMIZE -MD</div><div>QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MD</div><div>QMAKE_CFLAGS_DEBUG&nbsp; &nbsp; &nbsp; = -Zi -MDd</div>改为：<br /><div>QMAKE_CFLAGS_RELEASE&nbsp; &nbsp; = $$QMAKE_CFLAGS_OPTIMIZE -MT</div><div>QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MT</div><div>QMAKE_CFLAGS_DEBUG&nbsp; &nbsp; &nbsp; = -Zi -MTd<br /><br />修改文件：<br />C:\Qt\Qt5.10.1_src\qtbase\mkspecs\common\msvc-version.conf<br />在最前面加上：<br /><div>QMAKE_MSC_VER = 1900</div></div>否则会报错：<br /><div>msvc-version.conf loaded but qmake_msc_ver isn't set<br /><br />运行C:\Qt\Qt5.10.1_src&gt;configure.bat 确认配置</div><strong>5.编译：</strong><br />&lt;license&gt;选择-opensource<br /><strong>控制台选择：</strong><br /><div>开始 -&gt; Visual Studio 2015 -&gt; Developer Command Prompt for VS2015&nbsp;<br /><strong>编译选择</strong>：<br /><div>&nbsp;-skip &lt;repo&gt; ......... Exclude an entire repository from the build.<br />Ex:<br /><div>-skip qtwebengine<br /><div>C:\Qt\Qt5.10.1_src\qtwebengine</div></div><div>-nomake &lt;part&gt; ....... Exclude &lt;part&gt; from the list of parts to be built.<br />Ex:<br /><div>-nomake tools -nomake examples -nomake tests<br /><div>C:\Qt\Qt5.10.1_src\qtbase\tests</div></div><div>-make &lt;part&gt; ......... Add &lt;part&gt; to the list of parts to be built.<br /><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Specifying this option clears the default list first.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [libs and examples, also tools if not cross-building,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; also tests if -developer-build]<br /><div>-make libs -qt-zlib -qt-pcre -qt-libpng</div></div>Ex：<br /><div>C:\Qt\Qt5.10.1_src\qtbase\src\3rdparty\zlib</div></div></div></div><br /><div><strong>疯狂的缩减编译选择，可以用来尝试最小化编译，<span style="color: red;">当然我失败了</span>（ comercial user 可以用qt的Congiguration tool 然而我并没有，有些以来无法zh）</strong>：<br /><div>configure -confirm-license&nbsp;-opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_static"&nbsp; -make libs -nomake tools -nomake examples -nomake tests -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qttools -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -skip qtxmlpatterns -no-feature-texthtmlparser -no-feature-textodfwriter -no-feature-concurrent -no-feature-effects -no-feature-sharedmemory -no-feature-systemsemaphore -no-feature-im -no-feature-process -no-feature-dom -no-feature-filesystemmodel -no-feature-filesystemwatcher -no-feature-graphicsview -no-feature-graphicseffect -no-feature-sizegrip -no-feature-calendarwidget -no-feature-printpreviewwidget -no-feature-keysequenceedit -no-feature-colordialog -no-feature-filedialog -no-feature-fontdialog -no-feature-printpreviewdialog -no-feature-progressdialog -no-feature-inputdialog -no-feature-errormessage -no-feature-wizard -no-feature-datawidgetmapper -no-feature-imageformat_bmp -no-feature-imageformat_ppm -no-feature-imageformat_xbm -no-feature-imageformat_png -no-feature-imageformat_jpeg -no-feature-image_heuristic_mask -no-feature-image_text -no-feature-colornames -no-feature-cups -no-feature-paint_debug -no-feature-freetype -no-feature-translation -no-feature-codecs -no-feature-big_codecs -no-feature-iconv -no-feature-ftp -no-feature-udpsocket -no-feature-networkproxy -no-feature-socks5 -no-feature-networkdiskcache -no-feature-bearermanagement -no-feature-completer -no-feature-fscompleter -no-feature-desktopservices -no-feature-mimetype -no-feature-systemtrayicon -no-feature-undocommand -no-feature-undostack -no-feature-undogroup -no-feature-undoview -no-feature-statemachine -no-feature-gestures -no-feature-dbus -no-opengl&nbsp;<br /><br /><strong style="color: #339966;">成功的组合1</strong><strong>（想编译哪个 就去掉哪个skip）：</strong><br /><div>configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_mt_static" -make libs -nomake tools -nomake examples -nomake tests -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qttools -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -skip qtxmlpatterns -no-opengl&nbsp;<br />尝试2：<br /><div>configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_mt_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwinextras -skip qtx11extras&nbsp; -no-openssl&nbsp;</div><div></div><div>Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.<br />结果：<br /><div>Static builds of QtWebEngine aren't supported.</div><div>"Some of the required modules (android|ios|winrt|qtHaveModule(webengine)) are not available."<br />skip webengine 继续测试：<br /><div>configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_mt_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -skip qtx11extras&nbsp; -no-openssl&nbsp;<br />结果：<br />成功<br /><br /><strong style="color: #339966;">成功的组合2：</strong><br />configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_mt_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -skip qtx11extras&nbsp; -no-openssl&nbsp;</div></div></div></div></div></div></div><strong>成功的组合1只是在单独编译qtbase时有用，于是以后采用的成功的组合2，总结命令为：</strong><br />cd C:\Qt\Qt5.10.1_src<br /><div>configure -confirm-license -opensource -platform win32-msvc -static -debug-and-release -prefix "C:\Qt\Qt5.10.1_mt_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -skip qtx11extras&nbsp; -no-openssl&nbsp;<br />jom -j2<br />jom install<br /><br />plus1:<br /><div>WARNING: Using OpenGL ES 2.0 on Windows without ANGLE.</div><div>The build will most likely fail.</div><div>Specify -opengl desktop to use regular OpenGL.<br /><br />plus2:<br /><div>-skip qtwebengine , 都是Linux only</div><div>Webengine options:</div><div>&nbsp; -webengine-alsa ................ Enable ALSA support [auto] (Linux only)</div><div>&nbsp; -webengine-pulseaudio .......... Enable PulseAudio support [auto]</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(Linux only)</div><div>&nbsp; -webengine-embedded-build ...... Enable Linux embedded build [auto]</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(Linux only)</div><div>&nbsp; -webengine-icu ................. Use system ICU libraries [system/qt]</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(Linux only)<br /><br />plus3:<br />Static builds of QtWebEngine aren't supported.<br /><br /><h3>环境：Ubuntu 18.10/linux g++<br /></h3><div><strong><br />1.安装：</strong><br />安装了perl/python/ruby ( Linux 中 python2.x 的名字是python python3.x的名字是python3 )<br />统一安装：<br /><p>sudo apt-get install build-essential&nbsp;libpcap0.8-dev libx11-dev libfreetype6-dev libavahi-gobject-dev libsm-dev libxrender-dev perl python ruby</p><br /><strong>2.环境变量：</strong><br />linux的环境变量 只要不是特殊安装的，应该都被包含在内了<br /><br /><strong>3.代码：</strong><br /><div>同上<br /><br /><strong>4.动态链接改为静态链接：</strong><br /><div>linux没有md/mt，编译都时候 直接-static应该就可以。<br /><br /><strong>5.编译：</strong><br /><strong>尝试的组合1</strong>:<br />./configure -confirm-license -opensource -static -debug-and-release -prefix "/home/peng/Share/Qt5.10.1_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -no-openssl&nbsp;<br /><strong>编译出错</strong>：<br /><div>qfilesystemengine_unix.cpp:101:12: error: &#8216;int renameat2(int, const char*, int, const char*, unsigned int)&#8217; was declared &#8216;extern&#8217; and later &#8216;static&#8217; [-fpermissive]</div><div>bug fix：<br />这是跟glibc2.28有关的bug。。由于原来的patch已经对不上号，所以切换到5.10 或者5.11<br /><br /><strong>尝试的组合2</strong>（in qt 5.11）:<br />./configure -confirm-license -opensource -static -debug-and-release -prefix "/home/peng/Share/Qt5.10.1_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -no-openssl&nbsp;</div>configure执行出错：<br /><div>WARNING: -debug-and-release is only supported on Darwin and Windows platforms.&nbsp; Qt can be built in release mode with separate debug information, so -debug-and-release is no longer necessary.</div><div>ERROR: Feature 'debug_and_release' was enabled, but the pre-condition 'config.darwin || config.win32' failed.</div><div><strong>尝试的组合3</strong>（in qt 5.11）:<br />./configure -confirm-license -opensource -static -force-debug-info -prefix "/home/peng/Share/Qt5.11_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -no-openssl&nbsp;<br /><strong>编译出错</strong>：<br /><div>collect2: fatal error: ld terminated with signal 9 [Killed]</div><div>compilation terminated.</div><div>make[3]: *** [Makefile:135: ../../bin/qml] Error 1</div><div>make[3]: Leaving directory '/home/peng/qt5/qt5/qtdeclarative/tools/qml'</div><div>make[2]: *** [Makefile:155: sub-qml-make_first] Error 2</div><div>make[2]: *** Waiting for unfinished jobs....</div><div>make[3]: Leaving directory '/home/peng/qt5/qt5/qtdeclarative/tools/qmlpreview'</div><div>make[2]: Leaving directory '/home/peng/qt5/qt5/qtdeclarative/tools'</div><div>make[1]: *** [Makefile:75: sub-tools-make_first] Error 2</div><div>make[1]: Leaving directory '/home/peng/qt5/qt5/qtdeclarative'</div><div>make: *** [Makefile:159: module-qtdeclarative-make_first] Error 2<br /><br /><strong style="color: #339966;">尝试的组合4（成功的组合）</strong>（in qt 5.11）:<br /><div>./configure -confirm-license -opensource -static -force-debug-info -prefix "/home/peng/Share/Qt5.11_static" -make libs -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -nomake tools -nomake examples -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qttools -skip qtwebengine -skip qtwinextras -skip qtdeclarative&nbsp; -no-openssl&nbsp;<br />make -j2<br />make install<br />结果：<br />成功。</div></div></div><br />5.10.1的关于glibc的renameat的bug，被官方在5.11的branch里修复如下：<br /><div>commit 25feee4e061b99edab79503d81f5bd045c6c8e3d</div><div>Author: Thiago Macieira &lt;thiago.macieira@intel.com&gt;</div><div>Date:&nbsp; &nbsp;Tue Aug 7 09:38:42 2018 -0700</div><div></div><div>&nbsp; &nbsp; Fix qmake build with glibc 2.28</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; We haven't yet run the configure checks to see if statx and renameat2</div><div>&nbsp; &nbsp; are present in glibc, so this fails when we redefine the structures and</div><div>&nbsp; &nbsp; functions.</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; linux/stat.h:56:8: error: redefinition of 'struct statx_timestamp'</div><div>&nbsp; &nbsp; bits/statx.h:25:8: note: previous definition of 'struct statx_timestamp'</div><div>&nbsp; &nbsp; qfilesystemengine_unix.cpp:110:12: error: 'int renameat2(int, const char*, int, const char*, unsigned int)' was declared 'extern' and later 'static' [-fpermissive]</div><div>&nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; Change-Id: Ia741b559c24d46c78fb2fffd1548a792d22e3368</div><div>&nbsp; &nbsp; Reviewed-by: Oswald Buddenhagen &lt;oswald.buddenhagen@qt.io&gt;</div><div>&nbsp; &nbsp; Reviewed-by: J&#252;ri Valdmann &lt;juri.valdmann@qt.io&gt;<br /><br /><h3>环境：Ubuntu 18.04/交叉编译 arm<br /></h3><div><strong><br />1.安装：</strong><br />安装了perl/python/ruby ( Linux 中 python2.x 的名字是python python3.x的名字是python3 )<br />统一安装：<br /><p><span style="font-family: Arial; font-size: 10pt;">sudo apt-get install build-essential&nbsp;libpcap0.8-dev libx11-dev libfreetype6-dev libavahi-gobject-dev libsm-dev libxrender-dev perl python ruby&nbsp;</span><span style="font-family: Arial; font-style: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit; white-space: inherit; color: #242729; font-size: 10pt;">gcc-multilib g++-multilib<br /></span></p><div><span style="font-family: Arial; font-size: 10pt;">sudo apt-get install libxkbcommon-x11-dev libxkbcommon-dev libxcb-xkb-dev libxcb-cursor-dev libxcb1-dev libxcb-xtest0-dev libx11-xcb-dev<br />for opengl desktop:<br />sudo apt install&nbsp;</span><span style="color: #4d5156; font-family: arial, sans-serif; background-color: #ffffff;">libgl1-mesa-dev</span></div><p><span style="font-family: Arial; font-style: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit; white-space: inherit; color: #242729; font-size: 10pt;">for opengl es2:</span><span style="font-family: Arial; font-style: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit; white-space: inherit; color: #242729; font-size: 18pt;"><br /></span><span style="font-size: 10pt; font-family: Arial;">sudo apt-get install libglfw3-dev libgles2-mesa-dev</span></p></div></div><div></div><br />2. 配置<br /><div>./configure -recheck-all -confirm-license -opensource -xplatform linux-arm-gnueabihf-g++ -I /usr/arm-linux-gnueabihf/include -L /usr/lib/arm-linux-gnueabihf/ -L /lib/arm-linux-gnueabihf/ -L /usr/arm-linux-gnueabihf/lib/ -nomake tests -skip qtandroidextras -skip qtgamepad -skip qtmacextras -skip qtwebengine -skip qtwinextras -opengl es2 -qt-xcb -no-kms -prefix \"${PWD}/../qt-everywhere-install\"&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><br />参考文献：<br /><div>https://retifrav.github.io/blog/2018/02/17/build-qt-statically/</div></div></div><div>https://blog.csdn.net/u012822903/article/details/62058287</div></div></div></div></div></div><img src ="http://www.cppblog.com/hkingSP/aggbug/216289.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-03-08 11:00 <a href="http://www.cppblog.com/hkingSP/archive/2019/03/08/216289.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Git第三阶段：show log/show head/show modified/modify comment</title><link>http://www.cppblog.com/hkingSP/archive/2019/03/05/216287.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Tue, 05 Mar 2019 01:09:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/03/05/216287.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216287.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/03/05/216287.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216287.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216287.html</trackback:ping><description><![CDATA[<strong>查看日志（本地commit记录）：</strong><br />git log<br />result:<br /><div>commit f46a2277acf6b1604f3268fcd3652682f23347bc (HEAD -&gt; master)</div><div>Author: songpeng &lt;song.peng@bizerba.com&gt;</div><div>Date:&nbsp; &nbsp;Mon Mar 4 17:07:09 2019 +0800</div><strong>查看日志中的某次提交：</strong><br />git show&nbsp;f46a2277acf6b1604f3268fcd3652682f23347bc&nbsp;<br />查看各个日志都修改了哪些文件：<br /><div>git log --name-only<br />查看各个日志文件的具体修改：<br />git log -p /path_you_specified</div><br /><strong>查看本地代码修改情况</strong>：<br />已修改，未add的变更：<br />git diff<br />已add，未commit的变更：<br />git diff --cached<br />上面两条合并：<br />git diff HEAD<br />两个commit之间的区别：<br /><div>git diff 0da94be&nbsp; 59ff30c</div><br /><strong>变更日志内容（comment）:</strong><br />首先显示最近3次提交的commit:<br /><span>git rebase -i HEAD~3<br /></span>运行后显示如下(我是在windows里面安装了vim,内容会显示在vim里，不知道没安装vim会如何显示)：<br /><div>pick 41b65c0 recursive_search_and_link_libraries</div><div>pick 0de33bd success_built_with_vs2013lib_on_creator</div><div>pick 7ed1e94 success to built with vs2013lib and run on vs2013 ide</div>移动光标到想要修改commit的所在行，将pick改成reword，然后保存<br />然后刷新的界面内类似会出现你想修改的comment，将之修改保存。<br />然后运行：<br />git push --force，就会重新传到服务器，更新你要修改的comment.<br /><br /><br /><div></div><div></div><img src ="http://www.cppblog.com/hkingSP/aggbug/216287.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-03-05 09:09 <a href="http://www.cppblog.com/hkingSP/archive/2019/03/05/216287.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Git第二阶段：add files/undo add/branch add/branch view/branch new/branch delete/branch push/pull remote to local files/fetch origin</title><link>http://www.cppblog.com/hkingSP/archive/2019/03/04/216286.html</link><dc:creator>宋鹏</dc:creator><author>宋鹏</author><pubDate>Mon, 04 Mar 2019 08:26:00 GMT</pubDate><guid>http://www.cppblog.com/hkingSP/archive/2019/03/04/216286.html</guid><wfw:comment>http://www.cppblog.com/hkingSP/comments/216286.html</wfw:comment><comments>http://www.cppblog.com/hkingSP/archive/2019/03/04/216286.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/hkingSP/comments/commentRss/216286.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/hkingSP/services/trackbacks/216286.html</trackback:ping><description><![CDATA[<p><strong>add:</strong><br />git add *<br /><br /><strong>undo add:</strong><br />You can undo&nbsp;git add&nbsp;before commit with</p> <p>git reset &lt;file&gt;&nbsp;</p> <p>which will remove it from the current index (the "about to be committed" list) without changing anything else.</p> <p>You can use</p> <p>git reset<br /><br /><strong>add brach:</strong><br />git branch rikSkinLoader<br /><br /><strong>view branch:</strong><br />git branch -a<br /><br /><strong>switch branch:</strong><br /><span style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; background-color: #ffffff;">git checkout BranchName</span><br /><br /><strong>delete branch:</strong><br />git branch -d<br /><br /><strong>push branch:</strong><br />git push origin branchname<br /><br /><strong>pull:</strong><br /><span>git pull origin &lt;remote_branch&gt;：&lt;local_branch&gt;</span><br />git pull origin master:master</p><p><br /></p><div style="display: inline-block;"><br /><strong>查看远端变更/后续操作：<br /></strong>git remote update</div><p>&nbsp;</p><div>First use git remote update, to bring your remote refs up to date. Then you can do one of several things, such as:</div><p><br /></p><div>git status -uno&nbsp;<br />git status -uno&nbsp;will tell you whether the branch you are tracking is ahead, behind or has diverged. If it says nothing, the local and remote are the same.</div><div>git show-branch *master</div><div>git show-branch *master will show you the commits in all of the branches whose names end in 'master' (eg master and origin/master).</div><img src ="http://www.cppblog.com/hkingSP/aggbug/216286.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/hkingSP/" target="_blank">宋鹏</a> 2019-03-04 16:26 <a href="http://www.cppblog.com/hkingSP/archive/2019/03/04/216286.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>