Import an Eclipse C project into Visual Studio Code


I am developing a product with Colibri IMX8QXP + Iris 2.0 + Torizon. I am new to this Torizon. For this project I am reusing code from old projects. There are two processes reusing. One is a Qt program. Other is a C program written with Eclipse CDT.

I could deploy and run several qt and qml applications to the target through Visual Studio Code. Now I am trying to import some Eclipse C programs.

When search in google for “Importing Eclipse C project into Visual Studio Code”, it immediately gives a link: Importing an Eclipse project into VS Code — FIRST Robotics Competition documentation
But this is not working. As per their latest web page 2022, WPILib not supporting this: VS Code Overview — FIRST Robotics Competition documentation.
What is shown in this page is only eclipse keybindings-not an eclipse extension for Visual Studio code.
When I import an Eclipse C project with the Command: Torizon C/C++ Import existing Application, It is showing the error message: No Templates found.
So how can I do this ?
Thanks in advance for the help.

Greetings @sajeevank,

First of all I don’t have any knowledge about Eclipse CDT based projects, so my advice may not be the most detailed.

Our VSCode extension works by providing a number of templates. For example a Makefile based project, or a CMake based project. When you try to import an existing application with our extension it tries to fit your project into one of the known templates we have.

Based on the error you got it seems it wasn’t able to do so. This means you’ll probably have to do a more manual importing. You may need to start with a fresh VSCode, using whatever template most closely matches your Eclipse project. Then start copy and pasting code and files to match the VSCode project. I don’t have any knowledge about what your current Eclipse project is like, so this may be a very simple or a more complex task. You may also need to modify files to fit the new VSCode workflow.

With all that said I guess what kind of C project do you have? It is single file or multi-file? How is it built with Makefile, Cmake or just plain GCC from the command line?

Best Regards,

Hi Jeremias,

Thank You very much for the reply.

Actually I want to import a multi file C project written in Eclipse CDT. In Eclipse CDT, the project is built with Makefile. In the project concerned, there are about eight .c files and same number of .h files.

When we use Creat C/C++ project or Import C/C++ project, VSC is considering it as single file project only.

In the webpage : How to Import a C/C++ Application to Torizon | Toradex Developer Center there is an example project - fuse-emulator-fuse. In this the Project folder contains I think VSC determines the template from this file. I could run this application.
Whether we should write a for each project. That would be a very difficult task. Is there an easy way for a C/C++ project which contains two or more .c/.cpp files.
Please provide some workaround or references.

Hi Jeremias,

Regarding the same issue, I made one example project with just two .c files and one .h file.

#include <stdio.h>
#include “delay.h”
int main(int argc, char const *argv)
int cnt;
while(1) {
if (cnt > 100) {
printf(“Hello World!\n”);
return 0;


void delay_msec(int msec);
void delay_msec(int msec)
int loop_cnt;
int msec_cnt;
for (msec_cnt=0;msec_cnt<msec;msec_cnt++) {
for (loop_cnt=0;loop_cnt<1000000;loop_cnt++)


extern void delay_msec(int msec);

When I try to create a container for this project with Torizon C/C++ Create Project or Torizon C/C++ Import Project, it is showing build failure.

When I remove the line delay_msec(1000); from the main(), a container is successfully getting created.
So I think, if we have a procedure which works for the above two files, it can be extended for any number of files.

But VSC is not considering the second .c file.
Please suggest some workaround.

Well if you have a multi-file C/C++ project then you need something like a Makefile or CMake files to orchestrate the building of your application. Otherwise VSCode won’t know how it needs to build your application. For example the fuse-emulator-fuse article you saw was able to fit into a template because it had a file. You need to provide something equivalent with your project.

You said Eclipse CDT builds the project with Makefile, why can’t you just provide this Makefile with your project in VSCode?

Best Regards,

Hi Jeremias,

Thank You very much for the reply.
Now as per Your suggestion, I copied the Makefile from Eclipse Project into VSC Project folder. I did a little modifications to fix some errors. And the final Makefile is attached.
makefile (1.5 KB).
A dependent file is which just contains
USER_OBJS := TWO_FILES.o delay.o

With these files in the VSC project folder, now with Torizon C/C++ Import Project command I can import project and build it.

Tasks:Run Task Build_Debug, Build_Release, Clean working properly.

Executing task: make <

aarch64-linux-gnu-gcc -g -c -o TWO_FILES.o TWO_FILES.c
aarch64-linux-gnu-gcc -g -c -o delay.o delay.c
Building target: TWO_FILES
Invoking: Cross GCC Linker
**aarch64-linux-gnu-g++ -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -Wl,-O1 -Wl,–hash-style=gnu -Wl,–as-needed -fstack-protector-strong -Wl,-z,relro,-z,now -o “TWO_FILES” TWO_FILES.o delay.o **
Finished building target: TWO_FILES

So here an executable file is created.
torizon@hp-laptop:/workspaces/TWO_FILES$ ls
TWO_FILES TWO_FILES.c TWO_FILES.o appconfig_0 delay.c delay.h delay.o makefile

But when I Debug using the command: Run->Start Debugging it is showing the message:
> Executing task: make WORKDIR=/workspaces/TWO_FILES/appconfig_0/work/TWO_FILES install <
make: *** No rule to make target ‘install’. Stop.
The terminal process “/bin/bash ‘-c’, ‘make WORKDIR=/workspaces/TWO_FILES/appconfig_0/work/TWO_FILES install’” failed to launch (exit code: 2).

I think I am missing some configuration in tasks.json or launch.json. There was a pop up message saying the property program is not configured in launch.json . When I compare it with FUSE program it is same - program=""

The folder /workspaces/TWO_FILES/appconfig_0/work does not contain the executable file out TWO_FILES as shown below.

torizon@hp-laptop:/workspaces/TWO_FILES/appconfig_0/work$ ls

So I think build is not completed as required.

Please help me in solving this issue.

Looking at the error you got seems very telling:

Executing task: make WORKDIR=/workspaces/TWO_FILES/appconfig_0/work/TWO_FILES install <
make: *** No rule to make target ‘install’. Stop.

In short the extension invokes make install in order to install the compiled binaries to your project workdir. However the Makefile you copied from Eclipise probably didn’t have a rule for “install” which is why you get this error. You’ll need to probably slightly modify your Makefile to accommodate this.

As a reference for what to change/add create a fresh C/C++ Makefile based project with our extension. Then inspect the default Makefile in the fresh project. Notice how the “install” rule is defined there.

Best Regards,

1 Like

Hi Jeremias,

Thank You very much for the reply.
Sorry for my late reply. Actually I sent a reply Yesterday. But because of some technical glitches I had to discard that.

By comparing the Makefiles of VSC and Eclipse, I could make a working Makefile.
With that now

Tasks: Run Task clean
Tasks: Run Task build_debug
Run->Start Debugging
are working.

Run->Start Debugging is executed properly and execution stops at the start of the program. When I press resume key, it goes through the program. And then it stops at a point where the program access port pins. For that some more settings needed which I van find from Toradex documentations.

Thank You very much for guiding me nicely to solve all the problems I faced. :smiley:

Glad to hear you were able to import your project and get it running with our VSCode extension. I hope the rest of your development experience goes smoothly.

If you have any further issues don’t hesitate to open another thread on our community site.

Best Regards,

1 Like