Undefined reference in make

爱⌒轻易说出口 提交于 2019-12-12 03:55:26

问题


I'm compiling a code with many files and some are located in the local MATLAB installation folder. For this I've added an include to g++ which apparently doesn't resolve well because I get an undefined reference to for all MATLAB-C++ functions (I'm trying to use the MATLAB C++ Engine) as shown in the following screenshot:

The Makefile is very short and as such:

I've checked the referenced directory and it does include the "Engine.h" referenced by constraints.cpp which is generally enough to execute the MATLAB-C++ engine functions.

Any ideas as to where this problem could come from?


回答1:


You need to link with the MATLIB library files. Your code is referencing them, but the linker doesn't know what they are.



来源:https://stackoverflow.com/questions/35593792/undefined-reference-in-make

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!