Note that there are some explanatory texts on larger screens.

plurals
  1. POMEX File - Debugging LIBSVM in Visual Studio
    primarykey
    data
    text
    <p>I would like to debug a MEX file in Visual Studio (From MATLAB environment directly to C++ (Visual Studio 2012)). I've understood that this it is possible by adding the <code>-g</code> option to the make file. Attached you can find the makefile code I am using. What changes should be applied to make it work? Code:</p> <pre><code># This Makefile is used under Linux MATLABDIR ?= /usr/local/matlab # for Mac # MATLABDIR ?= /opt/local/matlab CXX ?= g++ #CXX = g++-4.1 CFLAGS = -Wall -Wconversion -O3 -fPIC -I$(MATLABDIR)/extern/include -I.. MEX = $(MATLABDIR)/bin/mex MEX_OPTION = CC\#$(CXX) CXX\#$(CXX) CFLAGS\#"$(CFLAGS)" CXXFLAGS\#"$(CFLAGS)" # comment the following line if you use MATLAB on 32-bit computer MEX_OPTION += -largeArrayDims MEX_EXT = $(shell $(MATLABDIR)/bin/mexext) OCTAVEDIR ?= /usr/include/octave OCTAVE_MEX = env CC=$(CXX) mkoctfile OCTAVE_MEX_OPTION = --mex OCTAVE_MEX_EXT = mex OCTAVE_CFLAGS = -Wall -O3 -fPIC -I$(OCTAVEDIR) -I.. all: matlab matlab: binary octave: @make MEX="$(OCTAVE_MEX)" MEX_OPTION="$(OCTAVE_MEX_OPTION)" \ MEX_EXT="$(OCTAVE_MEX_EXT)" CFLAGS="$(OCTAVE_CFLAGS)" \ binary binary: svmpredict.$(MEX_EXT) svmtrain.$(MEX_EXT) libsvmread.$(MEX_EXT) libsvmwrite.$(MEX_EXT) svmpredict.$(MEX_EXT): svmpredict.c ../svm.h ../svm.o svm_model_matlab.o $(MEX) $(MEX_OPTION) svmpredict.c ../svm.o svm_model_matlab.o svmtrain.$(MEX_EXT): svmtrain.c ../svm.h ../svm.o svm_model_matlab.o $(MEX) $(MEX_OPTION) svmtrain.c ../svm.o svm_model_matlab.o libsvmread.$(MEX_EXT): libsvmread.c $(MEX) $(MEX_OPTION) libsvmread.c libsvmwrite.$(MEX_EXT): libsvmwrite.c $(MEX) $(MEX_OPTION) libsvmwrite.c svm_model_matlab.o: svm_model_matlab.c ../svm.h $(CXX) $(CFLAGS) -c svm_model_matlab.c ../svm.o: ../svm.cpp ../svm.h make -C .. svm.o clean: rm -f *~ *.o *.mex* *.obj ../svm.o </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload