简体   繁体   中英

Build C executable for Raspberry Pi on Windows or Linux

I have to design a C executable (no GUI) that is supposed to run on Raspberry PI. I'm familiar with design using IDE like Visual Studio or Eclipse (with CDT plugin). If i use Raspberry PI as a design machine, I think I have no chance to use a standard IDE. I should use makefiles and gcc compiler only.

Is there any chance to develop Raspberry PI executable using Visual Studio (for Windows) or Eclipse (for both Windows and Linux).

You can specify to eclipse projects with Makefiles. You can also specify a compilation toolchain.

So yes, you can develop and compile for Raspberry Pi or for other plateforms using Eclipse.

For getting toolchain and other tools for Rasp Pi you can find things here .

In Eclipse, you create a new or import a project choosing Makefile Project with Existing Code then add your toolchain.

If you have a newer Pi like the 4, you should be able to run eclipse directly from the Pi desktop. You can download via:

sudo apt-get install eclipse

This will be a stripped-down version and will likely run quite slow, so I agree compiling on a more powerful remote machine is better...

Is there any chance to develop Raspberry PI executable using Visual Studio (for Windows) or Eclipse (for both Windows and Linux).

Yes, this is called cross-compiling. You can set up a cross-compile toolchain for the raspberry pi on windows or linux and configure your Eclipse CDT project to build with the toolchain. You can even set up remote debugging.

This website has good information and a step-by-step guide for windows using cygwin.

This looks like a good guide for linux.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM