[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51585] mex.h not compatible with Matlab imple

From: anonymous
Subject: [Octave-bug-tracker] [bug #51585] mex.h not compatible with Matlab implementation
Date: Wed, 26 Jul 2017 10:53:22 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/604.1 (KHTML, like Gecko) Version/11.0 Safari/604.1 Epiphany/3.24.3


                 Summary: mex.h not compatible with Matlab implementation
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Wed 26 Jul 2017 02:53:21 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: vito
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.1
        Operating System: GNU/Linux



Matlab mex.h requires extern "C" when included from C++. Octave mex.h fails to
build if it is wrapped in extern "C" with templates.

Simple example (main.cpp):

extern "C" {
    #include <mex.h>

void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])


$ g++ -I/usr/include/octave-4.2.1/octave main.cpp -o myfunc.mex
In file included from /usr/include/octave-4.2.1/octave/mex.h:51:0,
                 from main.cpp:2:
/usr/include/octave-4.2.1/octave/octave-config.h:94:1: error: template with C
 template <typename T>

Removing extern "C" around mex.h include fixes the problem, however it breaks
the build on Matlab.

This was tested on Linux with Octave 4.2.1.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]