简体   繁体   English

在Visual Studio 2010中使用SDCC?

[英]Using SDCC in Visual Studio 2010?

Is there a way to use the Visual Studio 2010 IDE with the Small Device C Compiler (SDCC)? 有没有办法将Visual Studio 2010 IDE与小型设备C编译器(SDCC)一起使用? I would like to compile using SDCC within Visual Studio. 我想在Visual Studio中使用SDCC进行编译。

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". 在键入“make”时编写使用SDCC构建项目的Makefile,在键入“make clean”时清除项目,并在键入“make clean all”时重建项目。
  2. Do File -> New Project and select "Makefile project". 执行文件 - >新建项目,然后选择“Makefile项目”。 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. 您可能必须将.sln.vcxproj文件移动到包含Makefile和源代码的目录,以便Visual Studio可以找到它。

At this point you should be able to build your project from inside Visual Studio. 此时,您应该能够从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. 不幸的是,看起来Visual Studio无法理解SDCC生成的错误消息的格式,因此如果您希望这样做,您必须重新配置Visual Studio或重新编译SDCC。 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: 我希望Visual Studio也能访问许多它不理解的SDCC关键字,例如“__code”,所以你可能不得不做这样的事情来隐藏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 . 如果您想查看有关将SDCC与Eclipse一起使用的一些说明,请参阅Wixel用户指南

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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