npm install -g @ohos/hpm-cli
sudo apt-get install net-tools
换源之后更新软件列表和升级软件。
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse
- deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse
2.3、shell设置sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3.8若系统已安装python3.8或python3.7以上版本则可跳过此步骤。
1)安装dosfstools。2.6、安装编译环境
sudo apt-get install dosfstools
2)安装mtools。
sudo apt-get install mtools
3)安装mtd-utils。
sudo apt-get install mtd-utils
wget https://repo.huaweicloud.com/harmonyos/compiler/gn/1523/linux/gn.1523.tar
wget https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar
wget https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-34042/linux/llvm-linux-9.0.0-34042.tar
wget https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar
设置环境变量注意:上述文件都是存放在用户的根目录的哦。
export PATH=~/gcc_riscv32/bin:$PATH
export PATH=~/ninja:$PATH
export PATH=~/gn:$PATH
export PATH=~/hc-gen:$PATH
export PATH=~/llvm/bin:$PATH
source ~/.baashrc
python build.py ipcamera_hi3516dv300 -b debug编译成功:
#include
#include "los_sample.h"
int main(int argc, char **argv)
{
printf("
************************************************
");
printf("
Hello World!
");
printf("
From: OHOS
");
printf("
************************************************
");
LOS_Sample(g_num);
return 0;
}
更多回帖