正文

watcom编译器的环境变量设置2008-08-20 09:30:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/vfdff/37714.html

分享到:

环境变量的设置具有优先级,也就是相同环境变量名下的多个变量值之间的关系是前面的变量具有优先级。而watcom对于环境变量比较敏感,需要优先设置。比如对一个程序编译的时候: wcl386 -zq -bd -bt=os2 -l=os2v2_dll -I%WATCOM%\h\os2 hello.c -"option implib" wcl386 -zq -bt=os2 -l=os2v2 main.c hello.lib 经常提示的错误: WATCOM C/C++32 Compile and Link Utility Version 10.0 Copyright by WATCOM International Corp. 1988, 1994. All rights reserved. WATCOM is a trademark of WATCOM International Corp. wcc386 TEST.C WATCOM C32 Optimizing Compiler Version 10.0a Copyright by WATCOM International Corp. 1984, 1994. All rights reserved. WATCOM is a trademark of WATCOM International Corp. C:\VC98\INCLUDE\stdio.h(23): Error! E1091: ERROR: Only Mac or Win32 看到了吧,这是由于默认采用了VC进行了编译,解决方法: You have installed or are using Visual C++. (Installing other compilers may cause similar problems.) WATCOM can still be used when other compilers are installed, however the environment variables INCLUDE, LIB, and WATCOM need to be set to the default values set by WATCOM when it was first installed. The WATCOM variable will be untouched by other compilers, so its usually best to redefine the INCLUDE and LIB environment variables in terms of %WATCOM% from batch files or makefiles. For example in makefiles the .BEFORE directive can be used for this purpose: .BEFORE @set INCLUDE=.;$(%watcom)\H @set LIB=.;$(%watcom)\LIB386 也就是把watcom的变量更改到前面即可,eg: 由: F:\Program_Files\VC98\mfc\lib;F:\Program_Files\VC98\lib;%WATCOM%lib286;%WATCOM%lib286dos; 变为 .;%WATCOM%lib286;%WATCOM%lib286dos;F:\Program_Files\VC98\mfc\lib;F:\Program_Files\VC98\lib; 参考:http://www.azillionmonkeys.com/qed/watfaq.shtml

阅读(3438) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册