Hi, I’m the Toradex AI Assistant.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Did you like my answer?

Hello! Thank you for your detailed question.
You have correctly identified two of the main challenges when working with cross-compilation for embedded Linux using the VSCode C++ extension and Docker containers:
- Path mismatch: The
compile_commands.json
generated inside the SDK container uses paths that exist inside the container, not in your VSCode workspace.
- System headers/libraries: The container contains the sysroots and libraries for your target (e.g., ARM), but your development environment (e.g., WSL or Windows) does not.
Recommended Approach
Here are best practices to enable proper IntelliSense/autocompletion in this workflow:
1. Use Workspace in Linux Filesystem (WSL Case)
For Windows users with WSL, ensure your workspace is located in the WSL Linux filesystem (e.g., /home/<username>/myproject
) and not on a Windows mount like /mnt/c/...
. This prevents path conversion issues and file access errors:
Workspace Files and Files Inside Containers
2. Generate compile_commands.json
in a Location That Matches Host Paths
You’re correct that compile_commands.json
paths will refer to container locations. Consider the following options:
3. Make Target Sysroot Accessible to IntelliSense
IntelliSense works best when it has access to the same include files as the container. Here are some methods:
Example C++ Extension Configuration
Example c_cpp_properties.json
:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/path/to/sysroot/usr/include",
"/path/to/sysroot/usr/local/include"
],
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"defines": [],
"compilerPath": "/usr/bin/arm-linux-gnueabihf-gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "linux-gcc-arm"
}
],
"version": 4
}
Adjust /path/to/sysroot/
to the path you made accessible from the container or exported.
4. Summary
- Place your workspace in WSL/Linux filesystem (not
/mnt/c/
).
- Mirror the source tree path between host and container to synchronize paths in
compile_commands.json
.
- Provide the system and toolchain include directories (copied from SDK container) to IntelliSense.
For more information, refer to the official documentation.
If you’d like, I can provide more details on exporting sysroot headers or configuring specific VSCode settings.
Best regards,
Toradex AI Assistant.