tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Crosscompiling


From: Michael Matz
Subject: Re: [Tinycc-devel] Crosscompiling
Date: Sat, 28 Jun 2014 18:44:37 +0200 (CEST)
User-agent: Alpine 2.00 (LNX 1167 2008-08-23)



On Fri, 27 Jun 2014, Markus Bergholz wrote:

      Make it clear where “mexPrintf” is defined and why it is not
      effective.


"mexPrintf" is defined in /usr/include/octave-3.8.1/octave/mexproto.h afaiu.

That's a declaration, not a definition. The definition comes from some Octave internal library. On linux you can build shared libraries that contain references to undefined symbols (like 'mexPrintf') that will then be resolved when loading the library (Octave itself or some library it depends on will define that symbol). That's what happens for your working example (your helloworld.mex will actually be an ELF shared library containing unresolved references to mexPrintf).

When you try the same for Windows you'll actually build a DLL. When it's supposed to contain references to external symbols then you at least need a .def file that describes which library will provide that symbol later. You'll also need to generate a .lib file describing the symbols exported by your helloworld.mex (so that octave can load it).

Generally for Octave the right way to create .mex files seems to be to use the helper program/script mkoctfile (with --mex), which presumably contains all the right libraries and other link parameters for each platform. If Octave supports external commands on Windows at all.

This all is not TCC specific, it's a problem in how you use Octaves system for C bindings. You'll probably get better answers asking their developers.


Ciao,
Michael.

reply via email to

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