bugGNU Octave - Bugs: bug #56078, ov.h:175: undefined reference to...

 
 

bug #56078: ov.h:175: undefined reference to `octave_value::nil_rep()', in both Windows & Ubuntu OS

Submitter:  None
Submitted:  Fri 05 Apr 2019 12:43:51 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Works For Me Assigned to:  None
Originator Name:  Emil Oanta Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 5.1.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 05 Apr 2019 05:12:18 PM UTC, comment #1: 

Thank you for the bug report. I am unable to reproduce this error on Debian with Octave 4.2, 4.4, or 5.1.

The error has to do specifically with how you are linking this one object file into an executable or a shared object. So the full mkoctfile or compiler command line is very relevant. If I use a plain "mkoctfile OCTAVE_cpp_double_2_octave_double.cpp", this error does not occur for me.

I'm closing this bug as "works for me" because there does not seem to be a bug here at all. If you need help in figuring out how to properly link your code with Octave, please use the help mailing list (https://lists.gnu.org/mailman/listinfo/help-octave).

Mike Miller <mtmiller>
Group Member
Fri 05 Apr 2019 12:43:51 PM UTC, original submission:  

Dear All,

I want to use C++ as a front end for Octave and a header file is


//-------------------------------------------------------------
/*
 *
 *  Name:                 OCTAVE_cpp_double_2_octave_double.h
 *  Created on:           May 27, 2017
 *  Author:               Emil
 *  Updated on:           October 13, 2017
 *  Project restarted on: April 05, 2019
 *
 *  Upper level goal: to use the Octave facilities in C++ code
 *
 */

#ifndef OCTAVE_CPP_DOUBLE_2_OCTAVE_DOUBLE_H_
#define OCTAVE_CPP_DOUBLE_2_OCTAVE_DOUBLE_H_

#ifdef __linux__
   // Linux code
   #include "/usr/include/c++/7/iostream"
   #include "/usr/include/octave-4.2.2/octave/oct.h" // Octave header
#elif _WIN32
   // Windows code
   #include <iostream>     // std::cout, std::end
   #include "C:\Octave\Octave-5.1.0.0\mingw32\include\octave-5.1.0\octave\oct.h"
   // The next one is not necessary??
   #include "C:\Octave\Octave-5.1.0.0\mingw32\include\octave-5.1.0\octave\builtin-defun-decls.h"
#else
   // Unknown operating system
#endif

octave_value OCTAVE_cpp_double_2_octave_double (double number);

#endif /* OCTAVE_CPP_DOUBLE_2_OCTAVE_DOUBLE_H_ */
//-------------------------------------------------------------
/*
 *
 *  Name:                 OCTAVE_cpp_double_2_octave_double.cpp
 *  Created on:           May 27, 2017
 *  Author:               Emil
 *  Updated on:           October 13, 2017
 *  Project restarted on: April 05, 2019
 *
 *  Upper level goal: to use the Octave facilities in C++ code
 *
 */
#ifdef __linux__
   // Linux code
   #include "./OCTAVE_cpp_double_2_octave_double.h"
#elif _WIN32
   // Windows code
   #include "OCTAVE_cpp_double_2_octave_double.h"
#else
   // Unknown operating system
#endif


octave_value OCTAVE_cpp_double_2_octave_double (double number) {
   octave_value return_ov;
   return_ov=static_cast<octave_value>(number);
   //return_ov=octave_value(number);
   return(return_ov);
}
//-------------------------------------------------------------


The error is the same in Windows and Ubuntu:

OCTAVE_cpp_double_2_octave_double.o: In function `Z33OCTAVE_cpp_double_2_octave_doubled':
C:\E\Workspace-Eclipse\_Headers\Debug/../OCTAVE_cpp_double_2_octave_double.cpp:44: undefined reference to `octave_value::octave_value(double)'
OCTAVE_cpp_double_2_octave_double.o: In function `ZN12octave_valueC1Ev':
BOLD
C:/Octave/Octave-5.1.0.0/mingw32/include/octave-5.1.0/octave/ov.h:175: undefined reference to `octave_value::nil_rep()'
BOLD

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #46723:  Screenshot from 2019-04-05 17-32-57.png added by None (397KiB - image/png - Screen shots in Ubuntu and in Windows OS)
file #46724:  01 eclipse.png added by None (182KiB - image/png - Screen shots in Ubuntu and in Windows OS)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-05 mtmiller StatusNone Works For Me
        Open/ClosedOpen Closed
    2019-04-05 None Attached File- Added Screenshot from 2019-04-05 17-32-57.png, #46723
        Attached File- Added 01 eclipse.png, #46724

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code