VSC is apparently using version 12 of g++ when it builds my app which is causing issues

I am using boost logging in my project. All was well until I had to redo my project with the xonsh build. It builds and links, but when I try to do any logging I get an exception. I don’t have this problem with the build under the ps build.
So I went to a newer version of boost, and that worked but the libraries are in compatible, I guess because I compiled boost with my on board version of g++ (13.3) and when I build my app it is using version 12. How do I get version 13 on the cross compiler in the tools when it builds the container.?
Thanks,

Steve

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I’d be glad to help with your Boost logging cross-compilation issue! To provide the most accurate guidance for your specific setup, could you let me know which OS and version you are running on your device?

You can use the tdx-info command to get detailed information about your hardware and software configuration. More details about this command can be found at: tdx-info

Once I know your platform details, I can provide specific guidance on:

  • Cross-compilation toolchain configuration
  • SDK setup for your target platform
  • Boost library compatibility resolution
  • Container build environment configuration

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI

Software summary

Bootloader: U-Boot

Kernel version: 6.6.94-7.3.0-g5a62539de8f9 #1-Torizon SMP PREEMPT Wed Jun 25 09:14:55 UTC 2025
Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/5c84b03643fe3e8b7be49b13c2171a7f45d0dce855097b9fafed3f75e9260a47/0
Distro name: NAME=“Torizon OS”
Distro version: VERSION_ID=7.3.0-build.18
Distro variant: VARIANT=“Docker”
Hostname: verdin-imx8mp-14762797

Hardware info

HW model: Toradex Verdin iMX8M Plus WB on Verdin Development Board

Toradex version: 0058 V1.1A
Serial number: 14762797
Processor arch: aarch64

Cross-Compilation Toolchain for Boost Libraries

Thanks for providing your system information! You’re running Torizon OS 7.3.0 on a Verdin iMX8M Plus with aarch64 architecture (1). The issue you’re experiencing with GCC version mismatch between your on-board compiler (13.3) and the cross-compilation toolchain (12) is a common compatibility problem.

Setting Up the Correct Cross-Compilation Environment

For your aarch64 platform, you need to set up the proper ARM GNU Toolchain (2). Here’s how to configure the correct toolchain version:

1. Download and Install ARM GNU Toolchain

For 64-bit modules like your Verdin iMX8M Plus, download the AArch64 GNU/Linux target toolchain (2):

$ wget -O arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz "https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz?rev=cf8baa0ef2e54e9286f0409cdda4f66c&hash=4E1BA6BFC2C09EA04DBD36C393C9DD3A"
$ tar xvf arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz

(2)

2. Set Up Toolchain Path and Environment

Create a symbolic link and configure environment variables (2):

$ ln -s arm-gnu-toolchain-12.3.rel1-x86_64-aarch64-none-linux-gnu gcc-linaro-aarch64

(2)

$ export ARCH=arm64
$ export DTC_FLAGS="-@"
$ export PATH=~/gcc-linaro-aarch64/bin/:$PATH
$ export CROSS_COMPILE=aarch64-none-linux-gnu-

(2)

3. Install Required Dependencies

Install the necessary build dependencies (2):

$ sudo apt-get install bc build-essential git libncurses5-dev lzop perl libssl-dev bison flex swig libyaml-dev pkg-config python3-dev

(2)

Resolving Library Compatibility

To ensure your Boost libraries are compatible with the target platform:

  1. Rebuild Boost with the correct cross-compiler: Use the same GCC version (12.3) that matches your target environment
  2. Use consistent toolchain: Ensure both your application and Boost libraries are compiled with the same cross-compilation toolchain
  3. Match target architecture: Verify that all libraries target aarch64 architecture

Container Build Environment

Since you mentioned container builds, make sure your container environment uses the same cross-compilation toolchain version to maintain ABI compatibility across all components.

The key is maintaining consistency between the GCC version used for Boost compilation and your application build process, both targeting the same aarch64 architecture of your Verdin iMX8M Plus module (1).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi @EvetsMostel1

Our containers generally use the version of tools that is the default in the Debian version they are based on. Right now we are on Debian Bookworm which supports gcc12. In theory you should be able to follow any debian-based instructions to install gcc13 but that may have other compatibility issues. The Dockerfile in your project should have all the container setup stuff and you should be able to modify to add additional package repos to get the newer version of gcc.

@drew.tx

Thanks Drew,

I will try that first.

Steve

@drew.tx

I tried installing it in the Dockerfile.sdk, but it wouldn’t go. That is where it needs to be, right?

Steve

Assuming you are using the standard cross-compile method I believe that’s correct. Do you get any errors or anything? Have you tried the install manually on a debian system/container? I wonder if it does not replace the gcc12 version but may be installed in a different location

@drew.tx

It is the build of the sdk that fails.

It just errors and says it didn’t complete the install, so the build of the sdk is incomplete.

What specifically did you add to the Dockerfile.sdk? I tried to install “gcc-13” in a standard bookworm container but it is not available in the default repos. You may need to add some extra repos if you can find some. Maybe you can change it to use Trixie but that feels like a pretty big change.

Drew