Alexis R Devitre
Alexis R Devitre

Reputation: 298

Undefined reference in make

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:

enter image description here The Makefile is very short and as such:

enter image description here

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?

Upvotes: 0

Views: 108

Answers (1)

1201ProgramAlarm
1201ProgramAlarm

Reputation: 32717

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

Upvotes: 2

Related Questions