C++在 PIC32 (MIPS32) 上运行
不幸的是,我的 PIC32 C 应用程序需要太多的 OO,我无法继续用 C 语言完成它。
您知道任何适用于 PIC32 的 MIPS32 C++ 编译器吗?
谢谢
Unfortunately, my C app for PIC32 needs OO too much and I can't continue doing it in C.
Do you know any MIPS32 C++ compiler for PIC32?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Microchip 的 XC32 工具链自 1.10 版起现在支持 C++
Microchip's XC32 tool chain now supports C++ since version 1.10
您可以联系ComeauComputing;他们的 C++ 编译器生成 C 代码作为中间语言,以便它可以利用平台现有的本机 C 编译器(只有 C 编译器可用),因此移植到新平台相对快速且简单。
由于各种原因,最终用户无法访问中间生成和编译器适配,因此您仍然需要 Comeau 生成 PIC32/C32 端口,但这可能不会花很长时间,希望他们能够分摊向其他用户销售的成本。
但是,如果您使用 Commeau 或任何其他 C++ 到 C 转换器,您将无法使用源代码级调试,这很可能成为在没有本机调试器支持的情况下成功使用 C++ 的任何尝试的杀手。
尽管它并不总是那么漂亮,但您最好的选择可能是学习如何用 C 实现 OO 设计。这是关于该主题的整本书:http://www.planetpdf.com/codecuts/pdfs/ooc.pdf
You might contact Comeau Computing; thier C++ compiler generates C code as an intermediate language so that it can then utilise a platform's existing native C compiler where only a C compiler is available, and therefore porting to new platforms is relatively quick and simple.
For various reasons the intermediate generation and compiler adaptation is not accessible to end users so you will still need Comeau to generate a PIC32/C32 port, but it probably won't take long and hopefully they would amortise the cost over sales to other users.
However if you use Commeau or any other C++ to C translator, you will suffer from the inability to use source-level debugging, and that is likley to be the killer to any attempt to use C++ sucessfully without native debugger support.
Although it is not always pretty, your best bet is probably to learn how to implement OO designs in C. Here's a whole book on the subject: http://www.planetpdf.com/codecuts/pdfs/ooc.pdf
根据这个 微芯片论坛上最近的帖子,看起来 C++ 对 PIC32 的支持不是'目前尚未在任何地方提供,并且不是 Microchip 的高度优先事项。该帖子中受访者的智慧似乎是:不要屏住呼吸。
我是 MPLAB 用户,自己构建小程序,所以我只使用 Microchip 提供的东西。我从来没有达到过认为我需要 C++ 的地步,渴望是的,但从来没有需要过。下一步,您可以考虑迁移到另一个支持 C++ 的平台,或者重新审视您的设计并询问为什么您如此需要 C++。一些特征可以用 C 语言模拟,并带来不同程度的痛苦和痛苦。
According to this fairly recent thread on the microchip forums it looks like C++ support for PIC32 isn't available anywhere yet and isn't a high priority with Microchip. The wisdom of the respondents in that thread appears to be: don't hold your breath.
I'm a MPLAB user myself building small programs so I just take what Microchip gives me. I've never gotten to the point where I thought I needed C++, longed for yes, but never needed. As a next step you can either consider moving to another platform with C++ support or take another look at your design and ask why you need C++ that badly. Some features can be simulated in C with varying amounts of pain and suffering.
您可能会留意正确的 GCC MIPS 端口。他们拥有所有的部分,但我不知道是否有人让 C++ 特别与 PIC32 一起工作。我知道它在 sgimips 上确实有效。
You might keep an eye on the proper GCC MIPS port. They have all the pieces, but I don't know if anyone's made C++ work with PIC32 in particular. I know it did work on sgimips.