compile 、build 、rebuild all区别联系

本文详细解释了在软件开发过程中,编译与构建的具体含义及其区别。包括了Compile、Build和Rebuild All这三个操作的不同之处,以及如何有效地管理和清理编译过程中产生的中间文件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

	compile只是将某个C或者CPP文件编译成obj文件,而build是将整个工程中的文件先Compile(编译),然后将编译生成的文件再Link(连接)成可执行文件。
	在Build菜单下有Compile,Build,Rebuild All三个菜单项用于编译程序。其中Compile用于编译当前打开的活动文档;Build只编译工程中上次修改过的文件,并链接程序生成可执行文件。如果以前没有作过编译,它会自动调用Rebuild All操作,依次编译资源文件、源程序文件等;Rebuild All不管文件是否作过修改,都会编译工程中的所有源文件。由于编译链接过程中会产生大量的中间文件和目标文件,它们占用许多硬盘空间,因此Visual Studio在Build下提供了Clean菜单项用于清除这些中间文件。用户在完成一个工程后,应及时清理这些中间文件,否则硬盘很快会被耗尽。
[OHOS ERROR] Traceback (most recent call last): [OHOS ERROR] File "/home/user/ohos/A-release-4-0/build/hb/services/gn.py", line 176, in _execute_gn_gen_cmd [OHOS ERROR] SystemUtil.exec_command(gn_gen_cmd, self.config.log_path) [OHOS ERROR] File "/home/user/ohos/A-release-4-0/build/hb/util/system_util.py", line 63, in exec_command [OHOS ERROR] raise OHOSException( [OHOS ERROR] exceptions.ohos_exception.OHOSException: Please check build log in /home/user/ohos/A-release-4-0/out/sdk/build.log [OHOS ERROR] [OHOS ERROR] During handling of the above exception, another exception occurred: [OHOS ERROR] [OHOS ERROR] Traceback (most recent call last): [OHOS ERROR] File "/home/user/ohos/A-release-4-0/build/hb/containers/status.py", line 47, in wrapper [OHOS ERROR] return func(*args, **kwargs) [OHOS ERROR] File "/home/user/ohos/A-release-4-0/build/hb/services/gn.py", line 178, in _execute_gn_gen_cmd [OHOS ERROR] raise OHOSException('GN phase failed', '3000') [OHOS ERROR] exceptions.ohos_exception.OHOSException: GN phase failed [OHOS ERROR] [OHOS ERROR] Code: 3000 [OHOS ERROR] [OHOS ERROR] Reason: GN phase failed [OHOS ERROR] [OHOS ERROR] Solution: Please check the compile log at out/{compiling product}/build.log, If you could analyze build logs. [OHOS ERROR] Or you can try the following steps to solve this problem: [OHOS ERROR] 1. cd to OHOS root path [OHOS ERROR] 2. run 'hb clean --all' or 'rm -rf out build/resources/args/*.json'. [OHOS ERROR] 3. repo sync [OHOS ERROR] 4. repo forall -c 'git lfs pull' [OHOS ERROR] 5. bash build/prebuilts_download.sh [OHOS ERROR] 6. rebuild your product or component [OHOS ERROR] [OHOS ERROR] If you still cannot solve this problem, you could post this problem on: [OHOS ERROR] https://gitee.com/openharmony/build/issues [OHOS ERROR] ohos-sdk build failed!
03-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值