matplotlib-cpp icon indicating copy to clipboard operation
matplotlib-cpp copied to clipboard

Undefined symbols for architecture arm64:....

Open cmezavalle opened this issue 2 years ago • 5 comments

Hello,

First, thanks for the great code. It is very helpful to have something nice to visualize the c++ results.

I have go through the code and it seems I am compiling it correctly. However, I am having the following error after the compilation:

"Undefined symbols for architecture arm64: "_engClose", referenced from: _main in MatlabPlot-8d1732.o "_engEvalString", referenced from: _main in MatlabPlot-8d1732.o "_engGetVariable", referenced from: _main in MatlabPlot-8d1732.o "_engOpen", referenced from: _main in MatlabPlot-8d1732.o "_engOutputBuffer", referenced from: _main in MatlabPlot-8d1732.o "_engPutVariable", referenced from: _main in MatlabPlot-8d1732.o "_mxCreateDoubleMatrix_800", referenced from: _main in MatlabPlot-8d1732.o "_mxDestroyArray_800", referenced from: _main in MatlabPlot-8d1732.o "_mxGetClassName_800", referenced from: _main in MatlabPlot-8d1732.o "_mxGetPr_800", referenced from: _main in MatlabPlot-8d1732.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)"

I wonder if there is a solution for this. I am running in an M1 MacBook Pro.

Thanks in advance.

cmezavalle avatar Apr 08 '23 22:04 cmezavalle

did you find an answer I have the same problem ?

ivnprad avatar Apr 21 '23 15:04 ivnprad

I have not. I posted the same issue in another repository as well, but no news.

https://github.com/Cryoris/matplotlib-cpp/issues/6

cmezavalle avatar Apr 25 '23 00:04 cmezavalle

I added this to the linker flags and it worked. I needed to tell c++ to link the Python API

            "-L/Library/Frameworks/Python.framework/Versions/3.11/lib",
            "-lpython3.11"

ivnprad avatar Apr 25 '23 05:04 ivnprad

Cool. Is it possible you can share your matplotlibcpp file and the line you used to compile? It seems I am still having something incorrect.

Thanks!

cmezavalle avatar Apr 25 '23 13:04 cmezavalle

Hi @ivnprad, would you mind to share the matplotlibcpp file and the line you used to compile?

Thanks in advance!!

cmezavalle avatar May 01 '23 20:05 cmezavalle