I need to get some data from a MatLab script and use them in a C++ project using MinGW, CMake and CLion. More precisely, I have to link the MatlabEngine and MatlabDataArray libraries to get the coordinates of some Kinect v2 vertices and draw them in an OpenGL 3D world. I've followed several tutorials like this (this is the second part, where it shows how to include the engine.h
file) and this. Adapting these tutorials to CMake, I've come up with this CMakeLists.txt
file:
cmake_minimum_required(VERSION 3.13)
project(3D_avatar)
set(CMAKE_CXX_STANDARD 14)
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ${CMAKE_MODULE_PATH} )
include_directories("D:/Matlab/extern/include" "D:/Matlab/extern/lib/win64/microsoft/")
add_executable(3D_avatar main.cpp glad.c Shader.h stb_image.h Camera.h utils.h)
target_link_libraries(3D_avatar -lglew32 -lglfw3 -lopengl32 -lglu32 -lgdi32 -lMatlabEngine -lMatlabDataArray)
Everything seems to look good, since CMake doesn't give me any error. But, when I compile the code, I get:
In file included from D:/Matlab/extern/include/MatlabEngine.hpp:14,
from C:\Users\fredd\CLionProjects\3D_avatar\main.cpp:23:
D:/Matlab/extern/include/MatlabEngine/engine_future.hpp:23:72: error: invalid use of incomplete type 'class std::future<std::unique_ptr<matlab::engine::MATLABEngine> >'
class FutureResult<std::unique_ptr<MATLABEngine>>: public std::future<std::unique_ptr<MATLABEngine>>{
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from D:/Matlab/extern/include/MatlabExecutionInterface/exception.hpp:10,
from D:/Matlab/extern/include/MatlabExecutionInterface.hpp:10,
from D:/Matlab/extern/include/MatlabEngine.hpp:9,
from C:\Users\fredd\CLionProjects\3D_avatar\main.cpp:23:
c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\future:125:11: note: declaration of 'class std::future<std::unique_ptr<matlab::engine::MATLABEngine> >'
class future;
^~~~~~
In file included from D:/Matlab/extern/include/MatlabEngine.hpp:14,
from C:\Users\fredd\CLionProjects\3D_avatar\main.cpp:23:
D:/Matlab/extern/include/MatlabEngine/engine_future.hpp:138:56: error: field 'future' has incomplete type 'std::future<std::unique_ptr<matlab::engine::MATLABEngine> >'
std::future<std::unique_ptr<MATLABEngine>> future;
^~~~~~
In file included from D:/Matlab/extern/include/MatlabExecutionInterface/exception.hpp:10,
from D:/Matlab/extern/include/MatlabExecutionInterface.hpp:10,
from D:/Matlab/extern/include/MatlabEngine.hpp:9,
from C:\Users\fredd\CLionProjects\3D_avatar\main.cpp:23:
c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\future:125:11: note: declaration of 'class std::future<std::unique_ptr<matlab::engine::MATLABEngine> >'
class future;
^~~~~~
Plus a bunch of similar errors, but with other functions of the same library. So, since I haven't edited the MatLab library in any way, that makes me wonder if I have linked the library correctly, but I can't really say what's wrong. What can I do?
Aucun commentaire:
Enregistrer un commentaire