help-octave
[Top][All Lists]
Advanced

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

Re: Windows/MSVC: install_builtins, octave_interpreter_ready not found


From: Michael Goffioul
Subject: Re: Windows/MSVC: install_builtins, octave_interpreter_ready not found
Date: Mon, 26 Nov 2007 15:05:03 +0100

On 11/26/07, address@hidden <address@hidden> wrote:
> Dear List,
>
> I have an C++ octave application running under Linux which uses multiple
> octave interpreters.
>
> While it works under Linux, when I try to compile it under Windows using
> MSVC++2005 and the octave-2.9.16 Windows built, the linker cannot
> resolve the following symbols:
>
> bool octave_interpreter_ready (toplev.h)
> void intall_builtins(void)
>
> See below for the compiler/linker flags.
>
> Is there a way to access these global variables and functions?

Unfortunately, not with the version you have.

> I have noted that some functions and global variables are declared using
> OCTINTERP_API and those are accessible under MSVC.

The problem is that unlike mingw, MSVC does not export symbols by
default; so you need to tell explicitely which symbols are exported in a
DLL; this is usually achieve using a XXX_API macro, which expand to
__declspec(dllexport) or __declspec(dllimport).

When I ported octave to MSVC, I added export macros "on-demand"
such that I could compile octave and octave-forge. So not all possible
octave symbols are available and it may happen that sometimes people
will need a symbol that is not exported. Accessing those symbols
requires to recompile octave, so there's no way with the version you
have.

I propose the attached patch to solve your problem. One "hard" job would
be to identify in the full source tree all symbols that need to be exported
and are part of octave API, and tag them with the appropriate macro.
But this is not something I gonna do....

Michael.

src/ChangeLog:

2007-11-26  Michael Goffioul <address@hidden>

    * toplev.h, builtins.h: export more symbols [Win32/MSVC]


Index: src/builtins.h
===================================================================
RCS file: /cvs/octave/src/builtins.h,v
retrieving revision 1.18
diff -c -p -r1.18 builtins.h
*** src/builtins.h      12 Oct 2007 21:27:29 -0000      1.18
--- src/builtins.h      26 Nov 2007 13:57:18 -0000
*************** along with Octave; see the file COPYING.
*** 23,29 ****
  #if !defined (octave_builtins_h)
  #define octave_builtins_h 1

! extern void install_builtins (void);

  #endif

--- 23,29 ----
  #if !defined (octave_builtins_h)
  #define octave_builtins_h 1

! extern OCTINTERP_API void install_builtins (void);

  #endif

Index: src/toplev.h
===================================================================
RCS file: /cvs/octave/src/toplev.h,v
retrieving revision 1.59
diff -c -p -r1.59 toplev.h
*** src/toplev.h        12 Oct 2007 21:27:34 -0000      1.59
--- src/toplev.h        26 Nov 2007 13:57:18 -0000
*************** extern octave_function *curr_parent_func
*** 52,61 ****

  // TRUE means we are ready to interpret commands, but not everything
  // is ready for interactive use.
! extern bool octave_interpreter_ready;

  // TRUE means we've processed all the init code and we are good to go.
! extern bool octave_initialized;

  class
  octave_call_stack
--- 52,61 ----

  // TRUE means we are ready to interpret commands, but not everything
  // is ready for interactive use.
! extern OCTINTERP_API bool octave_interpreter_ready;

  // TRUE means we've processed all the init code and we are good to go.
! extern OCTINTERP_API bool octave_initialized;

  class
  octave_call_stack


reply via email to

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