1.download bootlin toolchain gcc developer.nvidia.com/embedded/je…
2.unpack file:
$ mkdir $HOME/l4t-gcc
$ cd $HOME/l4t-gcc
$ tar xf <toolchain_archive>
3.write a "Hello world" cpp file.
4.write a makefile,like:
CXX = /xxx/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-g++
# Compiler flags
CXXFLAGS = -Wall -Wextra -std=c++17 -pthread
# Directories
SRCDIR = .
BINDIR = ../Release
# Target executable
TARGET = HelloWorld
TARGET_PATH = $(BINDIR)/$(TARGET)
# Source files
SOURCES = $(SRCDIR)/HelloWorld.cpp
# Include directories
INCLUDES = -I../Release -I.
# Default target
all: $(TARGET_PATH)
# Link the executable
$(TARGET_PATH): $(SOURCES)
$(CXX) $(CXXFLAGS) $(INCLUDES) $(LIBDIRS) -o $@ $< $(LIBS)
5.make this program.
6.over!!!