How to deal with : Errors parsing interface generation files. [...] error: cannot open source file "filesystem" (which belongs to the cpp standard librairy)?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi everyone,I hope that everything is good for you.
Context :
I have an issue about running c++ code inside MATLAB in order to display the data of my simulation.
For my school I have to develop a Barnes-Hut simulation on c++ and use MATLAB in order to display the simulation. As I want to display both the simulation and maybe times of execution, I'm trying to call the C++ libraries that I have made.
Something to notice about my librairies :
- Simulation.hpp includes Box.hpp
- Box.hpp includes Particule.hpp
- Particule.hpp includes Vecteur.hpp
Beginning of the Particule.hpp file :
/* Particule.hpp ==============================================================
* Copyright : None
* Original Authors : Etienne Rosin, Hajar Kissi, Wenyi Zhang
* License : None
* Description : header des classes Particules<dim> et ParticuleList<dim>
* Usage examples :
============================================================================ */
#ifndef PARTICULE_HPP
#define PARTICULE_HPP
/* Headers ==================================================================*/
// Related header
// C system headers
#include <math.h>
// C++ standard library headers
#include <random>
#include <filesystem>
// Other libraries' headers
// Project's headers
#include "Vecteur.hpp"
/* Namespaces ===============================================================*/
using namespace std;
namespace fs = std::filesystem;
/* Code =====================================================================*/
The code is :
%% Gestion des chemins d'acces
myFolders = split(pwd,"\");
NewPath = join(myFolders(1:end-1), "\");
file_path = "SIM202-orbite";
cppfile_path = fullfile(NewPath, file_path); % file path of my cpp project
% cpp files of the project
headers_path = fullfile(cppfile_path,"include/"); % file path of the project's headers
Vecteur_hpp = fullfile(headers_path,"Vecteur.hpp");
Particule_hpp = fullfile(headers_path, "Particule.hpp");
Box_hpp = fullfile(headers_path, "Box.hpp");
Simu_hpp = fullfile(headers_path, "Simulation.hpp");
librairies_path = "C:\msys64\mingw64\include\c++\12.2.0"; % file path of the c++ standard librairy
%% Try to import cpp project in order to use the results in matlab
clibgen.generateLibraryDefinition( ...
Simu_hpp, ...
PackageName = "Simu_Barnes_Hut", ...
OutputFolder = libFile);
% clibgen.generateLibraryDefinition( ...
% Simu_hpp, ...
% IncludePath = librairies_path, ...
% PackageName = "Simu_Barnes_Hut", ...
% OutputFolder = libFile, ...
% OverwriteExistingDefinitionFiles = true);
The error message is :
Error using main (line 45)
Errors parsing interface generation files.
C:\Users\erosi\OneDrive\Cours\ENSTA\2A\Info\SIM202_Projet_de_simulation_numerique\Programmation\SIM202-orbite\include\Particule.hpp(21):
error: cannot open source file "filesystem"
What I understand :
I understand that as I didn't specified the path of the "filesystem" file, MATLAB cannot open it.
My question :
Is there a way to "import" on MATLAB the cpp standard librairy librairies ? I tried to use
IncludePath = librairies_path
but I get a lot of error messages from the definition of the cpp files.
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Build MATLAB Interface to C++ Library en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!