help-octave
[Top][All Lists]
Advanced

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

Re: More - Problems with mkoctfile using GCC 4.8.1


From: Terry Duell
Subject: Re: More - Problems with mkoctfile using GCC 4.8.1
Date: Fri, 11 Oct 2013 14:54:45 +1100
User-agent: Opera Mail/12.16 (Linux)

Hello Mike,

On Fri, 11 Oct 2013 08:54:35 +1100, Mike Miller <address@hidden> wrote:

Hi Terry, did you mean to reply off-list or forget to reply-all?

Yes, I forgot to reply-all, sorry.

On Fri, Oct 11, 2013 at 08:24:43 +1100, Terry Duell wrote:
Fred.c was just a name as an example.
I don't have the specific error messages, but I recall they related to
mxDOUBLE.
I have just tried to reproduce the problem, but can't.
I'll have to go back and carefully check the situation again with .cpp and
.c sources.

Ok, what I was getting at was if you have a specific example file that
shows the error, because any example I created doesn't give me an
error.

Are you using Octave 3.6.4?

I tried with 3.6.4 (with the mexproto include moved as you noted) and
with the current development version, both worked with no error. I
don't work with mex files routinely, I just tried to see if I could
reproduce your error.


OK, I don't normally work with mex files either, but have been revisiting some code I worked with a couple of years ago, Matlab code provided by others, and didn't have any problems compiling the xxx.c or the xxx.cpp files at that time. Trying to rebuild working code from my source archive, I now run into problems. Below is a bit of a story of what I have been able to establish, hope it is understandable.

using mex.h as follows...

------------------
#if defined (__cplusplus)
#include "mexproto.h"  /*TLD 8-10-2013*/
extern "C" {
#endif

#if defined (V4)
void mexFunction (int nlhs, mxArray* plhs[], int nrhs, mxArray *prhs[]);
#else
void mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray *prhs[]);
#endif

/*#include "mexproto.h"*/

/* V4 floating point routines renamed in V5.  */
-----------------

errors compiling apply_blur_kernel_mex.c, but no errors compiling another version (apply_blur_kernel_mex.cpp in different set of code)

apply_blur_kernel_mex.c:87:62: error: ‘mxDOUBLE_CLASS’ undeclared (first use in this function) imblurry_ptr = mxCreateNumericArray(3, full_dims_blurry, mxDOUBLE_CLASS, mxREAL);
                                                              ^
apply_blur_kernel_mex.c:87:62: note: each undeclared identifier is reported only once for each function it appears in apply_blur_kernel_mex.c:87:78: error: ‘mxREAL’ undeclared (first use in this function) imblurry_ptr = mxCreateNumericArray(3, full_dims_blurry, mxDOUBLE_CLASS, mxREAL);
                                                                              ^
apply_blur_kernel_mex.c:88:14: warning: assignment makes pointer from integer without a cast [enabled by default]
     imblurry = mxGetPr(imblurry_ptr);
              ^
apply_blur_kernel_mex.c:95:16: warning: implicit declaration of function ‘mexErrMsgTxt’ [-Wimplicit-function-declaration]
                mexErrMsgTxt("theta not integral for uniform blur");
                ^
apply_blur_kernel_mex.c:107:22: error: ‘mwIndex’ undeclared (first use in this function)
                 i = (mwIndex)((xi-1)*h_blurry + yi - 1);
                      ^

with mex.h as follows (essentially the std mex.h in 3.6.4), no errors compiling apply_blur_kernel_mex.c but errors (in original post) compiling apply_blur_kernel_mex.cpp

-------------------
#if defined (__cplusplus)
/* #include "mexproto.h"  TLD 8-10-2013*/
extern "C" {
#endif

#if defined (V4)
void mexFunction (int nlhs, mxArray* plhs[], int nrhs, mxArray *prhs[]);
#else
void mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray *prhs[]);
#endif

#include "mexproto.h"

/* V4 floating point routines renamed in V5.  */
----------------------

Just to be clear, I am working with Octave 3.6.4 from the Fedora 19 repo (x86_64 version).
Fedora 19 uses gcc-4.8.1-1.fc19.x86_64.

What version of GCC are you using.

Hope this throws a bit more light on my problem.

Cheers,
--
Regards,
Terry Duell


reply via email to

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