Mex select wrong linker
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I have a problem with mex linker.
I have two files a.cpp and b.cpp and I create both object files a.obj and b.obj through mex -c command. Now I want to create the executable mex file through mex a.obj b.obj but when I try I get the error "undefined reference to operator new". Then I try with -v and -n options and I see that matlab uses gcc to link files instead of g++!
How can I manually switch between c\c++ compiler?
Respuestas (2)
Sonam Gupta
el 26 de Mzo. de 2018
mex -setup command helps you to select the desired compiler. Following documentation provides more information about the same:
2 comentarios
Michal Misiaszek
el 31 de Jul. de 2019
I use mex -setup command to set it to C++ but when I call mex to link object files it goes back to C instead of C++. How I can force mext to use g++ ? Please note I am just linking with MEX not compiling.
Wilson González
el 14 de Mayo de 2021
Having a similar situation to link .o files previously compiled with gfortran. Have you found a solution?
Ver también
Categorías
Más información sobre External Language Interfaces 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!