[英]Developing an Excel XLL using Mac OS X / Linux
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). 在过去的5年里,我一直在使用Visual Studio开发C ++模型,并将它们包装到Xll中以与Excel一起使用(使用xlw)。 The Excel add-in is the final product I want to deliver. Excel加载项是我想要提供的最终产品。
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. 但是,我相信使用Linux或Mac OS X可以更好地使用C ++编码。但我也相信通过Xll使用我的模型和Excel也非常实用,但遗憾的是只适用于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. 所以我想知道是否有办法在Mac OS X(或Linux)上实现,生成Excel加载项并在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. 我目前正在考虑的唯一方法是在Mac OS X上进行编码,编译项目时不包含有关Xll的部分,然后将项目加载到Visual Studio中并完全编译以生成Excel添加 - 在。 But to be honest, this sounds a bit laborious, and I'm hoping for an easier way. 但说实话,这听起来有点费劲,我希望有一个更简单的方法。
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. 我使用Mac OSX,Eclipse CDT和XCode以及使用插件的电子表格开发了一个C ++ Excel插件的工作示例。 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 . 这里有一个解释http://www.smr.co.uk/excel-addin-on-mac-os-x-using-cdt/包括使用的版本等,代码在这里https://github.com/PollardsEtFilles / MacCPPExcelAddinExample 。
There are two gotchas 有两个陷阱
clang (included with Xcode) is a good replacement for g++ clang(包含在Xcode中)是g ++的一个很好的替代品
All you need to do is install Eclipse CDT and import the code you'll be away. 您需要做的就是安装Eclipse CDT并导入您将要离开的代码。
It is possible. 有可能的。 You just need to use mingw (http://mingw-w64.sourceforge.net/) to compile from Linux. 你只需要使用mingw(http://mingw-w64.sourceforge.net/)从Linux编译。 I should note that you can then use g++ 4.7, which is a very decent C++ compiler with support for C++ 11x. 我应该注意,你可以使用g ++ 4.7,这是一个非常不错的C ++编译器,支持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. 交叉编译器可以在Mac和Linux上运行,因为它是gcc,您可以将它们与您喜欢的工具生态系统一起使用。
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. 此外,如果您正在使用http://kalx.net/xll/ ,这确实可以使您的生活更简单,您将不得不更新该库以实现严格的C ++一致性。
Best regards. 最好的祝福。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.