Trying to compile C++ Code to call it from Matlab. Issue with dependencies. Please help! :)

2 views (last 30 days)
Hi,
I've been trying to compile on Windows an algorithm to estimate noise sigma, but with many hurdles. The source code are in C++ in this link: http://www.ipol.im/pub/art/2013/45/
I'm trying to call it from Matlab for a school project, so I'm aiming to make some mex function or compiling the code as a .dll shared library in order to be able to call it from Matlab.
But I get stuck in both ways with a similar issue.
I've tried to compile the Makefile and the .cpp files in many ways and with different compilers (mingw, cywin, sdk, etc), but the compilers agree that the file "execinfo.h" is not included.
I've also tried downloading "execinfo.h" and adding it to the compilers "include" folder. That's ok, but then the compiler keeps asking for more and more dependecies like "fftw3.h", "png.h", etc , etc. Ive downloaded all of them until I found some of them that are not available on the web. Anyway I guess that this solution was not going to work at all.
The main question is if these Makefile and .cpps are compatible with Windows, and how to compile them correctly. Why are all these .h files missing? These code are supossed to be verified and tested.
Now i'm trying to compile teh makefile with Linux. But I thought with "Cywin" compiler I could compile any code written in Linux..
As you can guess, I'm newby to C++, and it's compilers. But I really need to run these codes to improve some performance in my Matlab project.
Please if you could give some answer I'd be really greatful. Thanks in advance!!

Answers (1)

Titus Edelhofer
Titus Edelhofer on 16 Jul 2015
Hi,
looking at the code and the line
#include <execinfo.h>
with < > instead of " " indicates that this is a system header file. Downloading this file only doesn't help, because it references other system header files as well. So straight forward this will work on a linux machine.
I admit it's quite a while that I used cygwin: I'm not sure if it provides those additional system header and library files. Downloading individual header files will definitely not work, since you need the code from the libraries as well ...
Titus
  1 Comment
sebastian bugna
sebastian bugna on 16 Jul 2015
Thanks a lot!
Well I run a virtual Linux in my machine and could finally compile it!
Is there a way to pass it from Linux (ubuntu) to my windows enviroment?
Or do I have to code all by myself again? :/
again, sorry for my newbie´s questions

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!