sbmlteam / libsbml

LibSBML is a native library for reading, writing and manipulating files and data streams containing the Systems Biology Markup Language (SBML). It offers language bindings for C, C++, C#, Java, JavaScript, MATLAB, Perl, PHP, Python, R and Ruby.

Home Page:https://sbml.org/software/libsbml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libsbml on Windows 11 with Visual Studio Code 17 2022

lmriccardo opened this issue · comments

After having installed the libsbml version 5.19.0 (it is the current stable release) I have tried to create a new CMake project in Visual Studio Code 17. In the project I have included all the dependencies required to "import" the libsbml functionalities. The main.cpp file is simply

#include <iostream>
#include <sbml/SBMLTypes.h>

int main()...

When compiling I have the error C2143: syntax error missing ',' before '<' that refers to line 116 of the header ListOf.h. The problem is the call to std::unary_function<SBase*, bool>, which has been deprecated from C++17 and removed from MSVC.

What do I have to do? Thanks

Please use one of our newer releases:

https://github.com/sbmlteam/libsbml/releases/tag/v5.19.7

or the git repository, to compile if you are using c++17 or higher, the only alternative that you'd have would be to set the CPP standard manually lower for cmake when configuring the project. Setting CMAKE_CXX_STANDARD to 14 or below would allow your project to compile.

Sorry for the inconvenience

No problem, I have solved using the v5.19.7 as you mentioned.

Thank you!