octave-maintainers
[Top][All Lists]
Advanced

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

Re: Compiling octave with MSVC


From: Michael Goffioul
Subject: Re: Compiling octave with MSVC
Date: Thu, 12 Oct 2006 21:41:02 +0200
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

John W. Eaton a écrit :
| One possible solution is to prefix exported functions with EXTERN macro | that you can define | to "extern" under UNIX and "__declspec(dllexport/dllimport)" under | Win32. For classes, it's | a little bit tricky as the modifier must be located after the "class" | keyword, and you can't put
| "extern" there.

Please post an example of one (or two) header file(s) that you have
modified so I can see precisely what it is that you need to do for
MSVC.  It would be helpful if the code you post has examples for both
functions and classes that need to be exported.

I've posted the current patches here:
http://www.geocities.com/sw286000/oct-build.diff.gz
http://www.geocities.com/sw286000/oct-code.diff.gz
http://www.geocities.com/sw286000/cccl.gz

oct-build.diff: patch focusing on build system
oct-code.diff: patch focusing on actualy code
cccl: GCC-to-MSVC compilation script (I did some modifications to the original script)

Building octave is then performed from the MSYS shell using the following configure command:
CC=cccl CXX=cccl ./configure --build=msdos --prefix=/usr/local/octave

Of course, the MSYS should be set up for MSVC development. The easiest is to start rxvt.exe from a well configured command prompt (which is usually obtained by running
vcvars32.bat script, provided with MSVC).

You probably won't agree with all the changes I made, it's only a starting point.

Note that I detected a problem in config.h generation. The template config.h.in contains
the lines:

#define OCTAVE_HAVE_POSIX_FILESYSTEM 1

#if defined (__WIN32__) && ! defined (__CYGWIN__)
#define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1
#undef OCTAVE_HAVE_POSIX_FILESYSTEM
#endif

When config.h is generated the #undef line gets commented (which is normal autoconf behavior, I guess). However, I really want to undefine OCTAVE_HAVE_POSIX_FILESYSTEM
to get correct behavior in file-ops.cc.

Michael.




reply via email to

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