Question

Is there a way to use the Visual Studio 2010 IDE with the Small Device C Compiler (SDCC)? I would like to compile using SDCC within Visual Studio.

Was it helpful?

Solution

If you want to go this route then you are going to have to figure a lot of things out for yourself. Here is how I would start:

  1. Write a Makefile that builds your project with SDCC when you type "make", and cleans your project when you type "make clean", and rebuilds your project when you type "make clean all".
  2. Do File -> New Project and select "Makefile project". Set the build, clean, and rebuild commands to the commands I said above.
  3. You might have to move the .sln and .vcxproj files to the directory with your Makefile and source code so Visual Studio can find it.

At this point you should be able to build your project from inside Visual Studio.

Unfortunately, it looks like Visual Studio does not understand the format of the error messages produced by SDCC, so either you would have to reconfigure Visual Studio or recompile SDCC if you want that to work. I will leave that as an exercise for you.

I expect that Visual Studio will also trip over a lot of the SDCC keywords that it does not understand, such as "__code" so you might have to do something like this to hide those keywords from Visual Studio:

#ifndef SDCC
#define __code
#endif

Overall, I expect you to have a lot of trouble.

If you'd like to see some instructions for using SDCC with Eclipse instead, see the Wixel User's Guide.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top