How can I compile c++ files created with the mex.h library from the command line?

2 views (last 30 days)
I have some c++ files that are intended to be compiled with mex through matlab from an open source repository. While they work just fine in matlab, I have to read in information from a file format that matlab doesn't deal with easily, so I would like to recompile the c++ files with a standard c++ compiler from the command line. Is there an easy way to do this? I've tried using g++ and it throws errors when it encounters the mex library.
Thanks!
  1 Comment
Harsheel
Harsheel on 1 Aug 2015
Can you clarify the following questions?
  1. What are these C++ files, do they contain mexFunction in them or are they general C++ files?
  2. What do you mean by "they work just fine in matlab"? C++ files cannot be directly executed in matlab.
  3. What is the command you use with g++ and what is the error?
  4. What is the reason you need mex libraries?

Sign in to comment.

Answers (0)

Categories

Find more on Write C Functions Callable from MATLAB (MEX Files) 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!