使用 Mac OS X / Linux 开发 Excel XLL
过去 5 年我一直使用 Visual Studio 开发 C++ 模型,并将它们包装到 Xll 中以便与 Excel 一起使用(使用 xlw)。 Excel 插件是我想要交付的最终产品。
然而,我相信使用 Linux 或 Mac OS X 进行 C++ 编码要好得多。但我也相信通过 Xll 将我的模型与 Excel 一起使用也非常实用,但遗憾的是仅适用于 Windows。
所以我想知道是否有一种方法可以在Mac OS X(或Linux)上实现,生成Excel插件并在Windows上使用它。
我目前正在考虑的唯一方法是在 Mac OS X 上进行编码,编译项目而不包括有关 Xll 的部分,然后将项目加载到 Visual Studio 中并完全编译它以生成 Excel 附件 -在。但说实话,这听起来有点费力,我希望有一种更简单的方法。
I've been developing C++ models using Visual Studio for the past 5 years, and wrapped them into Xll to be used with Excel (using xlw). The Excel add-in is the final product I want to deliver.
However, I believe C++ coding is way better using Linux or Mac OS X. But I also believe using my models with Excel through the Xll is also very practical, but sadly only works on Windows.
So I would like to know if there is a way to do the implementation on Mac OS X (or Linux), generate the Excel add-in and use it on Windows.
The only method to do so that I'm currently thinking of is doing the coding on Mac OS X, compile the project without including the part concerning the Xll, then load the project into Visual Studio and compile it entirely to generate the Excel add-in. But to be honest, this sounds a bit laborious, and I'm hoping for an easier way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是可能的。你只需要使用 mingw (http://mingw-w64.sourceforge.net/) 从 Linux 进行编译。我应该指出,您可以使用 g++ 4.7,这是一个非常不错的 C++ 编译器,支持 C++ 11x。交叉编译器可以在 Mac 和 Linux 上运行,并且因为它是 gcc,所以您可以将它们与您最喜欢的工具生态系统一起使用。
很少有意外的怪癖,但以防万一:
另外,如果您准备使用 http://kalx.net/xll/,这确实可以使您的生活更简单,您必须更新该库以严格遵守 C++。
此致。
It is possible. You just need to use mingw (http://mingw-w64.sourceforge.net/) to compile from Linux. I should note that you can then use g++ 4.7, which is a very decent C++ compiler with support for C++ 11x. The cross-compilers work both in Mac and Linux, and because it is gcc, you can use them with your favorite tool ecosystem.
There are few unexpected quirks, but just in case:
Also, if you are up for using http://kalx.net/xll/, which indeed can make your life simpler, you will have to update that library for strict C++ conformance.
Best regards.
我使用 Mac OSX、Eclipse CDT 和 XCode 开发了一个 C++ Excel 插件的工作示例,以及一个使用该插件的电子表格。解释在这里 http://www. smr.co.uk/excel-addin-on-mac-os-x-using-cdt/ 包括使用的版本等,代码在这里https://github.com/PollardsEtFilles/MacCPPExcelAddinExample。
有两个陷阱
clang(包含在 Xcode 中)是 g++ 的良好替代品
您所需要做的就是安装 Eclipse CDT 并导入您将要使用的代码离开。
I've developed a working example of a C++ Excel addin using Mac OSX, Eclipse CDT and XCode and a spreadsheet that uses the addin. An explanation is here http://www.smr.co.uk/excel-addin-on-mac-os-x-using-cdt/ including versions used etc and the code is here https://github.com/PollardsEtFilles/MacCPPExcelAddinExample.
There are two gotchas
clang (included with Xcode) is a good replacement for g++
All you need to do is install Eclipse CDT and import the code you'll be away.