Error Using Mex Compiler

3 views (last 30 days)
Stacey
Stacey on 15 Jan 2016
Commented: Stacey on 19 Jan 2016
I'm trying to compile using the command "mex MEXIrradiation.cpp"
Matlab is returning this error:
Error using mex
/tmp/mex_17281680784358282_33076/MEXIrradiation.o: In function `mdlOutputs(SimStruct_tag*, int)':
MEXIrradiation.cpp:(.text+0x3a0): undefined reference to `PVLCLR::PVL_Utils::irradiation(long, PVLCLR::PVL_Location const&,
PVLCLR::PVL_Orientation const&, double, double&, double&, double&, double&, double&, double&, double&)'
collect2: error: ld returned 1 exit status
Does anyone know how I can fix this?

Answers (1)

Walter Roberson
Walter Roberson on 15 Jan 2016
Well we can tell you to define
PVLCLR::PVL_Utils::irradiation(long, PVLCLR::PVL_Location const&,
PVLCLR::PVL_Orientation const&, double, double&, double&, double&, double&, double&, double&, double&)
Perhaps you have defined that routine with a different signature that is not compatible with how it was called.
We cannot give you more then very generic advice as we have never seen your code, and the routine names you mention do not appear to be part of any code indexed anywhere by Google.
  3 Comments
Walter Roberson
Walter Roberson on 15 Jan 2016
You copied your .cpp file twice instead of showing the .h
You do not show a #include of the .h file.
Stacey
Stacey on 19 Jan 2016
Ok. I just updated it. Sorry about that.

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!