bugGNU Octave - Bugs: bug #39856, MSVC: cannot compile an oct-file...


bug #39856: MSVC: cannot compile an oct-file in 64-bit Windows 7 or Vista

Submitted by:  Dave Robinson <davewr2013>
Submitted on:  Thu 22 Aug 2013 08:14:11 PM UTC  
Category: Configuration and Build SystemSeverity: 3 - Normal
Priority: 3 - LowItem Group: Incorrect Result
Status: Need InfoAssigned to: None
Originator Name: Dave RobinsonOpen/Closed: Open
Release: 3.6.4Operating System: Microsoft Windows

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Thu 22 Aug 2013 10:38:02 PM UTC, comment #2:

I left out one piece of info. Sorry about that!

The math .h file is in

Top of file is:


  • This file is part of msvcmath library.
  • Author: Michael Goffioul


#ifndef _MSC_VER
# error "this header can only be used with Visual C++ compiler"

/* Make sure math constants are defined */

Dave Robinson <davewr2013>
Thu 22 Aug 2013 09:00:45 PM UTC, comment #1:

math.h isn't an Octave file.

What do we need to change in Octave?

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Thu 22 Aug 2013 08:14:11 PM UTC, original submission:

This applies to the Ocatve Version configured for WIndows install -- Microsoft Visual Studio 2010 version

The Dynamically Linked Function example Oct-File example in the manual at page 669 (685 of PDF) will not compile.

The compiler indicates that the mkoctfile compiler is not available -- actually it is a broken link to the Microsoft Visual Studio C compiler.

The following is a simple change that will allow compiling an oct file in Windows 7 and Windows Vista 64

Line 74 of math.h needs to be changed to compile if a 32 bit compiler is used -- like the C Express compilers.

Note that the only change is to add "(x86)" to line 74 as indicated.

/* Include VC++ original math.h */
#include <c:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/include/math.h>

Using this batch file from a command prompt in the home directory appears to start Octane 3.6 correctly. This assumes that the Microsoft Visual Studio Express 2010 C++ compiler is installed.

echo off
cd C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\
call vcvarsall.bat x86
cd C:\Software\Octave-3.6.4\

Dave Robinson <davewr2013>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by davewr2013 (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 22 Feb 2015 05:56:30 PM UTCmtmillerPriority5 - Normal=>3 - Low
      SummaryCannot compile an Oct-File in Windows 7 64 or Vista 64 oct file=>MSVC: cannot compile an oct-file in 64-bit Windows 7 or Vista
    Thu 24 Oct 2013 11:25:07 PM UTCrik5CategoryNone=>Configuration and Build System
    Thu 22 Aug 2013 09:00:45 PM UTCjordighStatusNone=>Need Info

    Back to the top

    Powered by Savane 3.1-cleanup