补上今天引发环境变量大研究的case。。。
---------------- 分割线 -------------------
今天手动调侯捷的深入浅出MFC中的样例。
结果make过程中遇到奇怪错误:
link: invalid option -- s
Try `link --help' for more information.
看了下样例里的GENERIC.MAK 的相关几行:
generic.exe : generic.obj generic.res
link /MACHINE:I386 -subsystem:windows generic.res generic.obj /
libc.lib kernel32.lib user32.lib gdi32.lib
我怀疑是/machine -subsystem等参数的问题
上网查了一番,倒搞清了很多细节问题,比如:
照着资料,发现咋这里的link参数这么奇怪呢
资料上明明是/SUBSYSTEM
这里咋成了-subsystem
疑惑中,尝试将-subsystem改成/SUBSYSTEM再试
结果错误变了:
kernel32.lib user32.lib gdi32.lib
link: extra operand `generic.res'
Try `link --help' for more information.
这下彻底傻眼。
晕了一份来钟,好吧,那就按提示说的,看看帮助里说些啥吧。
这一打帮助,立即囧掉。
Usage: link FILE1 FILE2
or: link OPTION
Call the link function to create a link named FILE2 to an existing FILE1.
--help display this help and exit
--version output version information and exit
Report bugs to <bug-coreutils@gnu.org>.
我的天哪,搞了半天我是在用GNU的linker在链接。
去系统的环境变量找了一番,发现原来是它搞的鬼:
%SystemRoot%/system32;%SystemRoot%;%SystemRoot%/system32/Wbem;C:/cygwin/bin;%MSSdk%/Bin;%MSSdk%/Bin/WinNT;F:/Microsoft Visual Studio/Common/MSDev98
将红色部分移到最后,问题解决。
环境变量,以后得小心哪!!