help-octave
[Top][All Lists]
Advanced

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

Re: mkoctfile and linking newbie question


From: roumbaba
Subject: Re: mkoctfile and linking newbie question
Date: Wed, 27 May 2009 16:32:36 -0700 (PDT)



John W. Eaton-3 wrote:
> 
> On 27-May-2009, roumbaba wrote:
> 
> | Ok I have found a way around:
> | 
> | The same command with the -v option display the gcc commands issued.
> | It turns out that my -l option gets called at compile (-c) time and not
> a
> | link time for some reason.
> | So now instead of using mkoctfile use system( ) with the correct gcc
> | arguments order.
> | 
> | 
> | 
> | roumbaba wrote:
> | > 
> | > Hi,
> | > 
> | > I am trying to build a .mex file using mkoctfile --mex as described in
> the
> | > octave manual.
> | > I need to link in some other library 'libmylib.a' in my mex file.
> Trying
> | > to follow the manual I am doing something like this:
> | > 
> | > mkoctfile --mex '-I/myincludedir/ -L/mylibdir/ -lmylib'
> mymexfunction.c
> | > 
> | > but I get the following message from mkoctfile:
> | > powerpc-apple-darwin8-gcc-4.0.1: -lmylib: linker input file unused
> because
> | > linking not done
> | > 
> | > and 
> | > 
> | > /usr/bin/ld: Undefined symbols:
> | > _mylib_symbol1
> | > collect2: ld returned 1 exit status
> | > 
> | > What am I doing wrong?
> 
> Try omitting the quotes around the -I, -L, and -l arguments.  With the
> quotes, mkoctfile sees
> 
>   '-I/myincludedir/ -L/mylibdir/ -lmylib'
> 
> as a single argument, and thinks it is just one -I argument for the
> compiler.  It never sees the -L or -l arguments, so it doesn't add
> them to the correct commands.
> 
> I tried without quotes and also with quotes for each argument, I get lots
> of error messages that look like these:
> _gzflush referenced from liboctinterp expected to be defined in
> /tmp/dependencies-ppc/lib/libz.1.dylib
> _gzgetc referenced from liboctinterp expected to be defined in
> /tmp/dependencies-ppc/lib/libz.1.dylib
> _gzputc referenced from liboctinterp expected to be defined in
> /tmp/dependencies-ppc/lib/libz.1.dylib
> _gzread referenced from liboctinterp expected to be defined in
> /tmp/dependencies-ppc/lib/libz.1.dylib
> _gzungetc referenced from liboctinterp expected to be defined in
> /tmp/dependencies-ppc/lib/libz.1.dylib
> _gzwrite referenced from liboctinterp expected to be defined in
> /tmp/dependencies-ppc/lib/libz.1.dylib
> _gzclose referenced from liboctinterp expected to be defined in
> /tmp/dependencies-ppc/lib/libz.1.dylib
> 
> | > btw: will a .mex file compiled using mkoctfile run under matlab?
> 
> Probably not.
> 
> How come? I thought matlab was also using gcc? 
> I am not using matlab but the person I want to make my .mex is. That is
> why I am making a .mex instead of a .oct.
> Is there a way to do my development and testing in octave and then compile
> for matlab (windows)? Or must I purchase matlab matlab and .mex compiler? 
> 
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
> 
> 

-- 
View this message in context: 
http://www.nabble.com/mkoctfile-and-linking-newbie-question-tp23735843p23752686.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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