Windows 下 使用 VSCode 和 arm-none-eabi 编译Linux代码时 mkdir 命令出错

2024-01-16 21:04

本文主要是介绍Windows 下 使用 VSCode 和 arm-none-eabi 编译Linux代码时 mkdir 命令出错,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

编译环境:

IDE: VSCode

交叉编译器:arm-none-eabi

make 命令:Mingw-w64 GCC for Windows 64

源代码管理:git

交叉编译器版本和安装目录: E:\work_soft\gcc-arm-none-eabi-10.3-2021.10

Mingw 版本和目录:E:\work_soft\x86_64-13.2.0-release-posix-seh-ucrt-rt_v11-rev1

问题描述:

Windows 下使用 make 命令编译一些 Linux 平台编译 OK 的代码时,往往会出错。一个典型的错误是 mkdir  "不是内部或外部命令,也不是可运行的程序" 错误:

PS F:\开源硬件\逆向\1-FNIRSI-1013D\F1C100s_projects> make -C .\projects\hello_led\
make: Entering directory 'F:/开源硬件/逆向/1-FNIRSI-1013D/F1C100s_projects/projects/hello_led'
"mkdir" build/
'"mkdir"' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
make: *** [../../f1c100s_common.mk:63: build/exception.o] Error 1
make: Leaving directory 'F:/开源硬件/逆向/1-FNIRSI-1013D/F1C100s_projects/projects/hello_led'

出错的 Makefile 文件如下:

$(BUILDDIR)/%.o: %.c"mkdir" -p $(dir $@)$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@

解决办法:

解决办法在文末

更改后编译成功:

Jian@DESKTOP-R4PHV6R MINGW64 /f/F1C100s_projects (master)
$ make -C projects/hello_led/
make: Entering directory 'F:/F1C100s_projects/projects/hello_led'
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf exception.c -o build/exception.o
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf main.c -o build/main.o
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf system.c -o build/system.o
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/arm926/src/image.S -o build/image.o
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/arm926/src/vectors.S -o build/vectors.o
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/arm926/src/cache-v5.S -o build/cache-v5.o
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_clock.c -o build/f1c100s_clock.o   
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_de.c -o build/f1c100s_de.o
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_gpio.c -o build/f1c100s_gpio.o     
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_intc.c -o build/f1c100s_intc.o     
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_pwm.c -o build/f1c100s_pwm.o       
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_sdc.c -o build/f1c100s_sdc.o       
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_timer.c -o build/f1c100s_timer.o   
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_touch.c -o build/f1c100s_touch.o   
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_tvd.c -o build/f1c100s_tvd.o       
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_tve.c -o build/f1c100s_tve.o       
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../f1c100s/drivers/src/f1c100s_uart.c -o build/f1c100s_uart.o     
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../lib/printf/printf.c -o build/printf.o
mkdir -p build/
arm-none-eabi-gcc -c -march=armv5te -mtune=arm926ej-s -mfloat-abi=soft -marm -mno-thumb-interwork -g -ggdb -Wall -fdata-sections -ffunction-sections -ffreestanding -std=gnu99 -Os -fomit-frame-pointer -Wall -fverbose-asm -DLOAD_HEADER  -D__ARM32_ARCH__=5 -D__ARM926EJS__ -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES=1 -DPRINTF_ALIAS_STANDARD_FUNCTION_NAMES_HARD=1 -I. -I../../f1c100s/arm926/inc -I../../f1c100s/drivers/inc -I../../lib/printf ../../lib/syscalls/syscalls.c -o build/syscalls.o
arm-none-eabi-gcc -nostartfiles -Xlinker --gc-sections -T../../f1c100s/f1c100s_dram.ld -Wl,--defsym=DRAM_SIZE=32M,-Map=build/hello_led.map,--cref,--no-warn-mismatch -o build/hello_led.elf build/exception.o build/main.o build/system.o build/image.o build/vectors.o build/cache-v5.o build/f1c100s_clock.o build/f1c100s_de.o build/f1c100s_gpio.o build/f1c100s_intc.o build/f1c100s_pwm.o build/f1c100s_sdc.o build/f1c100s_timer.o build/f1c100s_touch.o build/f1c100s_tvd.o build/f1c100s_tve.o build/f1c100s_uart.o build/printf.o build/syscalls.o -lgcc -lm -lc_nano
arm-none-eabi-objcopy -O binary build/hello_led.elf build/hello_led.bintext    data     bss     dec     hex filename23243       0 8930452 8953695  889f5f build/hello_led.elf
make: Leaving directory 'F:/F1C100s_projects/projects/hello_led'

更改的 VSCode 默认的终端为 Git 终端:

这篇关于Windows 下 使用 VSCode 和 arm-none-eabi 编译Linux代码时 mkdir 命令出错的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/613887

相关文章

Python并行处理实战之如何使用ProcessPoolExecutor加速计算

《Python并行处理实战之如何使用ProcessPoolExecutor加速计算》Python提供了多种并行处理的方式,其中concurrent.futures模块的ProcessPoolExecu... 目录简介完整代码示例代码解释1. 导入必要的模块2. 定义处理函数3. 主函数4. 生成数字列表5.

Python中help()和dir()函数的使用

《Python中help()和dir()函数的使用》我们经常需要查看某个对象(如模块、类、函数等)的属性和方法,Python提供了两个内置函数help()和dir(),它们可以帮助我们快速了解代... 目录1. 引言2. help() 函数2.1 作用2.2 使用方法2.3 示例(1) 查看内置函数的帮助(

Linux脚本(shell)的使用方式

《Linux脚本(shell)的使用方式》:本文主要介绍Linux脚本(shell)的使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录概述语法详解数学运算表达式Shell变量变量分类环境变量Shell内部变量自定义变量:定义、赋值自定义变量:引用、修改、删

Python实例题之pygame开发打飞机游戏实例代码

《Python实例题之pygame开发打飞机游戏实例代码》对于python的学习者,能够写出一个飞机大战的程序代码,是不是感觉到非常的开心,:本文主要介绍Python实例题之pygame开发打飞机... 目录题目pygame-aircraft-game使用 Pygame 开发的打飞机游戏脚本代码解释初始化部

基于Python实现一个Windows Tree命令工具

《基于Python实现一个WindowsTree命令工具》今天想要在Windows平台的CMD命令终端窗口中使用像Linux下的tree命令,打印一下目录结构层级树,然而还真有tree命令,但是发现... 目录引言实现代码使用说明可用选项示例用法功能特点添加到环境变量方法一:创建批处理文件并添加到PATH1

Java使用HttpClient实现图片下载与本地保存功能

《Java使用HttpClient实现图片下载与本地保存功能》在当今数字化时代,网络资源的获取与处理已成为软件开发中的常见需求,其中,图片作为网络上最常见的资源之一,其下载与保存功能在许多应用场景中都... 目录引言一、Apache HttpClient简介二、技术栈与环境准备三、实现图片下载与保存功能1.

Python中使用uv创建环境及原理举例详解

《Python中使用uv创建环境及原理举例详解》uv是Astral团队开发的高性能Python工具,整合包管理、虚拟环境、Python版本控制等功能,:本文主要介绍Python中使用uv创建环境及... 目录一、uv工具简介核心特点:二、安装uv1. 通过pip安装2. 通过脚本安装验证安装:配置镜像源(可

LiteFlow轻量级工作流引擎使用示例详解

《LiteFlow轻量级工作流引擎使用示例详解》:本文主要介绍LiteFlow是一个灵活、简洁且轻量的工作流引擎,适合用于中小型项目和微服务架构中的流程编排,本文给大家介绍LiteFlow轻量级工... 目录1. LiteFlow 主要特点2. 工作流定义方式3. LiteFlow 流程示例4. LiteF

使用Python开发一个现代化屏幕取色器

《使用Python开发一个现代化屏幕取色器》在UI设计、网页开发等场景中,颜色拾取是高频需求,:本文主要介绍如何使用Python开发一个现代化屏幕取色器,有需要的小伙伴可以参考一下... 目录一、项目概述二、核心功能解析2.1 实时颜色追踪2.2 智能颜色显示三、效果展示四、实现步骤详解4.1 环境配置4.

使用jenv工具管理多个JDK版本的方法步骤

《使用jenv工具管理多个JDK版本的方法步骤》jenv是一个开源的Java环境管理工具,旨在帮助开发者在同一台机器上轻松管理和切换多个Java版本,:本文主要介绍使用jenv工具管理多个JD... 目录一、jenv到底是干啥的?二、jenv的核心功能(一)管理多个Java版本(二)支持插件扩展(三)环境隔