I am trying to use Cantera and compile the simple Cantera "Hello World" program from Visual Studio and I'm have a rather difficult time. I've tried many things at this point and I keep hitting problems. Specifically, I'm trying to get everything compiled in a 64-bit mode. My end goal is to link to the Cantera libraries from another 64-bit code and to have Cantera calculate reaction rates and equilibrium values. So, I'm interested in interfacing with the Cantera libraries from a C++ interface. To be clear, I'm not interested in modifying the Cantera source code, but rather, I just want to link to it.
It may be worth pointing out that I've successfully tested my 64 bit Cantera installation in Python 3.4 and Matlab. I've successfully been using Cantera in Matlab to calculate some things, but now want to move to a C++ interface.
To start, my first question is this: can I simply link to the cantera.lib file that was created when I ran the Cantera Windows installed (
https://github.com/Cantera/cantera/releases). Do I need to be able to compile Cantera or do I simply need the provided Cantera include files and cantera.lib file?
Here's my basic set up:
MS Windows 7 Ultimate (64 bit)
Visual Studio 2015 Pro
Cantera 2.2.1 (64 bit)
Python 2.7, 32 bit (for SCons)
SCons 2.4.1
Pre-build 64-bit boost libraries for MSVC-14 (include and lib directories are: C:\local\boost_1_61_0 and C:\local\boost_1_61_0\lib64-msvc-14.0)
Sundials 2.6.1 (built with CMake, include and lib directories are: C:\sundials-2.6.2-install\include and C:\sundials-2.6.2-install\lib)
I switch the target platform to x64. Under the project properties for the x64 target platform, I add the following:
- Under C/C++ --> General --> Additional Include Directories: C:\Program Files\Cantera\include, C:\local\boost_1_61_0, C:\sundials-2.6.2-install\include
- Under Linker --> General --> Additional Library Directories: C:\Program Files\Cantera\lib, C:\local\boost_1_61_0\lib64-msvc-14.0, C:\sundials-2.6.2-install\lib
- Under Linker --> Input --> Additional Dependencies: cantera.lib



OK, having done all of that, when I compile I get 100s of linker warnings and errors. See attached file (Output-Build1.txt). The linker complains about the default lib MSCVRT conflicting with other libs. So I turned on "no default libraries" and then still receive 100s of linker errors with respect to cantera.lib. See second attached file (Output-Build2.txt).
Does anyone have experience seeing any of these error messages in Visual Studio? Thanks in advance for any responses.
Regards,
Nick