make: /usr/bin//-g++: No such file or directory

Hi

I got a vs code environment on my host (ubuntu 22.04), and i want to cross-compile an application for imx8mp board.

It worked pretty good intil i install some libraries and g++ compilers on my pc.

Now when i trying to build the application i got this:

rm main.o 1553.o brmMaster.o UartDrivers.o main
/usr/bin//-g++ --sysroot=/opt/fslc-xwayland/4.0/sysroots/armv8a-fslc-linux -Wall -g -c main.cc
make: /usr/bin//-g++: No such file or directory
make: *** [Makefile:10: main.o] Error 127
/usr/bin/g++ is going to be your host compiler, not your cross-compiler.

What did you actually install when you installed the cross-compiler?

Just downloading the header files and pointing at them with sysroot isn't sufficient.
i install yocto toolchain
then source:
source /opt/fslc-xwayland/4.0/environment-setup-armv8a-fslc-linux
Then CXX automatically align with the target compiler

it used to work, until i install some libraries and compilers for
petalinux 2020.2

Makefile example:
1
2
3
4
all: main.cpp
	$(CXX) $(CXXFLAGS) -Og main.cpp -g -o hello
clean:
	rm -f hello


MY question is whether my (CXX) got corrupted somehow?

Notice here: /usr/bin//-g++ it interpret somehow that the compiler is -g++
Notice here: /usr/bin//-g++ it interpret somehow that the compiler is -g++

This looks like some variables in the CXX path have been expanded to empty strings!

I assume that the path was actually defined like /usr/bin/${subdir}/${target}-g++, but $subdir and $target are empty/undefined.

Normally, a GCC cross-compiler is called something like aarch64-linux-gnu-gcc or aarch64-linux-gnu-g++.

...while the "native" compiler (i.e. the compiler that targets the same platform that you are building on) is simply called gcc or g++.
Last edited on
Registered users can post here. Sign in or register to post.