bugGNU Octave - Bugs: bug #53920, mkoctfile tries to link with...


bug #53920: mkoctfile tries to link with /scratch/build/.../libiconv.dll.a

Submitted by:  Fred Hoeve <fredh>
Submitted on:  Wed 16 May 2018 08:09:56 AM UTC  
Category:  Octave Function Severity:  4 - Important
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  Confirmed Assigned to:  None
Originator Name:  Fred H Open/Closed:  Open
Release:  4.4.0 Operating System:  Microsoft Windows

Add a New Comment(Rich Markup)

You are not logged in

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


( Jump to the original submission)

Mon 21 May 2018 12:44:22 PM UTC, comment #10:

You can override the OCTAVE_LINK_DEPS value by setting it with set env:

John Donoghue <lostbard>
Project Member
Thu 17 May 2018 09:45:49 PM UTC, comment #9:

Hi Fred - this is a bug tracker, not a support tracker. Your contributions will be very welcome if you have suggestions or patches to help fix this bug that you have brought to our attention.

Mike Miller <mtmiller>
Project Administrator
Thu 17 May 2018 02:10:09 PM UTC, comment #8:

Hi, not sure if I understand all your comments. Do i have to change a setting to get mkoctfile working ? If so, please tell me how to do this. Thanks

Fred Hoeve <fredh>
Thu 17 May 2018 03:05:35 AM UTC, comment #7:

if I read lib-link.m4 correctly, since it is finding a .a file, it is treating it as a static lib and hence using the full path, rather than the I guess a special case? where its really a stub for the dll.

John Donoghue <lostbard>
Project Member
Wed 16 May 2018 09:05:24 PM UTC, comment #6:

That is all correct information. On a typical GNU/Linux system, the iconv function is included in glibc, so both LIBICONV and LTLIBICONV should be empty.

It is also correct that Octave builds itself using the Libtool variant LTLIBICONV, but uses the non-Libtool variant LIBICONV when embedding the string into mkoctfile.

The only thing that is incorrect about this is that Gnulib's code for checking for libiconv is embedding the fixed path to the library into LIBICONV. The logic for all of this is in Gnulib's AC_LIB_LINKFLAGS macro (lib-link.m4).

Mike Miller <mtmiller>
Project Administrator
Wed 16 May 2018 08:41:23 PM UTC, comment #5:

and in configure.ac,



John Donoghue <lostbard>
Project Member
Wed 16 May 2018 08:38:25 PM UTC, comment #4:

I'm not sure how libtool vs the rest works, but for reference, when looking in config.log when cross building octave for windows.

LTLIBICONV = -L/thelibpath -liconv -R/thelibpath

LIBICONV = /thelibpath/libiconv.dll.a -L/thelibpath

On my native fedora build:


John Donoghue <lostbard>
Project Member
Wed 16 May 2018 08:20:36 PM UTC, comment #3:

I added the gnulib module here:

I am seeing the following during bootstrap:

I didn't touch the makefile (or configure fwiw). Does something need to be changed in those as well?

Markus M├╝tzel <mmuetzel>
Project Member
Wed 16 May 2018 06:30:08 PM UTC, comment #2:

In the config.log

The check for libiconv comes directly from Gnulib, but maybe there is a cache variable or an option that can be used to influence the result here.

Mike Miller <mtmiller>
Project Administrator
Wed 16 May 2018 04:06:12 PM UTC, comment #1:

Running on mine, libiconv wasn't being included on 4.2.2, so was never an issue. The -I and -L parts are mix of the build and the current config in both versions.

In 4.4, iconv is being added to the dependant libs, but in this case is that it is using the full path to the libiconv.dll.a file instead of using a -liconv or equivalent.

Running mkoctfile -p OCTAVE_LINK_DEPS (in 4.4) shows it as the only library being used that way.

John Donoghue <lostbard>
Project Member
Wed 16 May 2018 08:09:56 AM UTC, original submission:

If I specify the command
mkoctfile --link-stand-alone standalone.cc -o standalone.exe -verbose
then got the message
g++: error: /scratch/build/mxe-octave-w64-32-stable/usr/x86_64-w64-mingw32/lib/libiconv.dll.a: No
such file or directory

In 4.2.2 the library and include was set to the installation folder, e.g. c:\octave4.2.2\....

Code standalone.cc

#include <iostream>
#include <octave/oct.h>

main (void)
std::cout << "Hello Octave world!\n";

int n = 2;
Matrix a_matrix = Matrix (n, n);

for (octave_idx_type i = 0; i < n; i++)
for (octave_idx_type j = 0; j < n; j++)
a_matrix(i,j) = (i + 1) * 10 + (j + 1);

std::cout << a_matrix;

return 0;

Fred Hoeve <fredh>


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by fredh (Submitted the item)
  • -email is unavailable- added by fredh (Octave mkoctfile)

    Do you think this task is very important?
    If so, you can 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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    Wed 16 May 2018 06:30:08 PM UTC mtmiller Severity3 - Normal => 4 - Important
        Item GroupNone => Unexpected Error
        StatusNone => Confirmed
        Summarymkoctfile, include and lib paths are wrong => mkoctfile tries to link with /scratch/build/.../libiconv.dll.a
    Wed 16 May 2018 08:09:56 AM UTC fredh Carbon-Copy- => Added -email is unavailable-

    Back to the top

    Powered by Savane 3.3