[Top][All Lists]

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

[Octave-bug-tracker] [bug #37122] mex with subdirs links same object twi

From: anonymous
Subject: [Octave-bug-tracker] [bug #37122] mex with subdirs links same object twice (multiple definition)
Date: Thu, 16 Aug 2012 14:11:48 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1


                 Summary: mex with subdirs links same object twice (multiple
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Thu 16 Aug 2012 02:11:47 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Other
                  Status: None
             Assigned to: None
         Originator Name: Clemens Buchacher
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.1
        Operating System: Microsoft Windows



Octave version: 3.6.1 gcc4.6.2 (i686-pc-mingw32)

Octave errors out with a multiple definition error when compiling a mex file
with two additional compilation units f.c and g.c, which are located in a

> mex mex_test.c subdir/f.c subdir/g.c
subdir.o: In function `g':
C:\.../subdir/g.c:1: multiple definition of `g'
subdir.o:C:\.../subdir/g.c:1: first defined here
collect2: ld returned 1 exit status

It seems that Octave creates a subdir.o instead of f.o and g.o, and then it
gets confused.

I tested the same in Matlab 2011b on Linux/Windows and Octave 3.4.3 on Linux,
where it works as expected (no error).

Here are minimal file contents to reproduce the error:

/* file: mex_test.c */
#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, mxArray const* prhs[])

/* file: subdir/f.c */
void f() {}

/* file: subdir/g.c */
void g() {}


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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