Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup a cross compiler and XLW build environment

Tested InterfaceGenerator compilation run on Ubuntu 19.10. Originally tested on Ubuntu 14.04LTS.

XLW version used XLW_VERSION "5.0.2f0".

The modified files have been committed to this repository (please see final comment!)

  1. Install the mingw-w64 package: sudo apt-get install mingw-w64

It is about 100mb of downloads. While it is downloading, do the following.

  1. Download and extract a zip/tarball of the xlw repository from: http://sourceforge.net/p/xlw/code/

  2. Correct the directory paths in xlw/make/make.targets, near the end.

  3. Build the interface generator by going to xlw/build/gcc-make: cd build/gcc-make

make -f InterfaceGenerator.mak BUILD=RELEASE

This will give InterfaceGenerator.exe in xlw/build/gcc-make/RELEASE/BIN

Note that the file is a Linux executable, despite the .exe ending.

I emphasise, you will be running this file on Linux. Use your standard GCC compiler at this step.

  1. Check the interface generator works OK with the example provided.

cd xlw/examples/Start Here - Example/common_source

../../../build/gcc-make/RELEASE/BIN/InterfaceGenerator.exe Test.h xlwTest.cpp

This should generate a xlwTest.cpp, which calls all the XLW specific code to interface your functions.

  1. By now, the download and install of mingw-w64 will have finished.

The compiler executable is x86_64-w64-mingw32-g++.

  1. The file NCmatrices.* sometimes has an uppercase 'm', sometimes not. Linux is case sensitive, of course. I went for uppercase. Thus I changed
  • The filename in include/xlw directory
  • The filename in the src directory.
  • Within the XLW.mak makefile.
  • Within NCmatrices.cpp.

Similarly,

  • IXlfOperShared.h has inconsistent case for the 'O'.
  • xlfFuncDesc.h (and a few others) have inconsistent case for the 'X' in XlFunctionRegistration.cpp

Possibly it is easiest to fix these by repeatedly trying to recompile until you get them all (see step below).

  1. Go back to the XLW build directory. The cross compiler prefix 'x86_64-w64-mingw32-' is already set in the makefiles, you just need PLATFORM=x64. I.e. type:

make -f XLW.mak BUILD=RELEASE PLATFORM=x64

I also made a 32 bit target plaform: make -f XLW.mak BUILD=RELEASE PLATFORM=x32

This will make a file libxlw-gcc-s-5_0_2f0.a in the lib/x64 directory. Possibly there are some bad filename lower/upper case problems that I missed.

  1. Now you have the interface file and the library. Build the example Excel plugin as follows:

make PLATFORM=x64 BUILD=RELEASE XLW=../../../..

make PLATFORM=x32 BUILD=RELEASE XLW=../../../..

  1. For my own plugin, I do (When the interface changes): ./xlw/xlw/build/gcc-make/RELEASE/BIN/InterfaceGenerator.exe Excel.h Excel.cpp

then: make -f XLL.mak PLATFORM=x32 BUILD=RELEASE XLW=xlw

2020 Update

Revisited these notes after making a minor changes to my Excel PlutoTaschePD calculator.

Files committed here based on modification date, ASCII only, and ignoring the files in examples/Start Here - Example: find . -type f -newermt '9/27/2015 0:00:00' > modified_files.txt

file -f /tmp/modified_files.txt | awk -F: '/ASCII text/ {print $1}' | grep -v git | xargs -d'\n'

About

Old notes on cross compiling Excel plugins on Linux with MinGW (for Windows) with the XLW library

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages