Link error with VS2015 "unresolved external symbol __iob_func"

17,299 views
Skip to first unread message

Florent Laroche

unread,
Aug 26, 2015, 11:01:53 AM8/26/15
to dislin-users
Hello,

Since 4-5 years, i use Dislin in a project C++/MFC.
Now, i compile this project with Visual Studio 2013 (compiler VC++12)
I'm trying to migrate my project on Visual Studio 2015 (compiler VC++14) but i have an error on linker :

1>discpp.lib(disini.obj) : error LNK2001: unresolved external symbol ___iob_func
1>discpp.lib(disbs2.obj) : error LNK2001: unresolved external symbol ___iob_func
1>discpp.lib(resall.obj) : error LNK2001: unresolved external symbol ___iob_func
1>discpp.lib(errmes.obj) : error LNK2001: unresolved external symbol ___iob_func


According to my investigate, Microsoft has made major change in CRT Runtime :
"The static library needs to be compiled with the same compiler toolset that the application is compiled with."

In visual studio 2015, stdin, stderr, stdout are defined as follow :
#define stdin  (__acrt_iob_func(0))
#define stdout (__acrt_iob_func(1))
#define stderr (__acrt_iob_func(2))

But previously, they were defined as:
#define stdin  (&__iob_func()[0])
#define stdout (&__iob_func()[1])
#define stderr (&__iob_func()[2])


Can you recompile Dislin with VS2015 ?
Thank you

Andi Z

unread,
Aug 27, 2015, 9:53:57 AM8/27/15
to dislin-users
Hello,

I encountered a similar problem with Dislin for Intel Fortran, x64 on Windows using VS2015 (Community edition) and the Intel(R) Visual Fortran Compiler 16.0, both of which I installed recently. I have also VS2010 installed, with which my dislin programs with the new Fortran compiler run fine, so I assume this has to do with the Visual Studio 2015 version and the requirements of interoperability during the linker step.

This is the output with the error messages I get in VS2015 for a small dislin test program:

1>------ Build started: Project: bargraph_test1, Configuration: Debug x64 ------
1>Linking...
1>disifl_d.lib(disini.obj) : error LNK2019: unresolved external symbol __iob_func referenced in function disfin
1>disifl_d.lib(resall.obj) : error LNK2001: unresolved external symbol __iob_func
1>disifl_d.lib(reset.obj) : error LNK2001: unresolved external symbol __iob_func
1>disifl_d.lib(errmes.obj) : error LNK2001: unresolved external symbol __iob_func
1>disifl_d.lib(qqwini.obj) : error LNK2019: unresolved external symbol sscanf referenced in function qqwfil
1>disifl_d.lib(wtiff.obj) : error LNK2001: unresolved external symbol sscanf
1>disifl_d.lib(qqppng.obj) : error LNK2019: unresolved external symbol sprintf referenced in function qqpdf5
1>x64\Debug\bargraph_test1.exe : fatal error LNK1120: 3 unresolved externals


On the dislin website FAQ (http://www.mps.mpg.de/1758446/faq_kap4#q_5 ), the settings for MS Visual Studio 2005, 2008 or 2010 are stated. It would be nice if we could extend dislin support/documentation to newer versions like VS2013 and VS2015, since many users will migrate to these Visual Studio versions in future (the new Intel Fortran Compiler will come with a VS2013 shell and VS2010 support will be phased out in future).

If there are new settings in the linker properties to be used, documentation on that would also be helpful.
In VS, since I use the Windows x64 double precision dislin library (dl_10_ic) I set:  Project properties > Linker > Input > Additional Dependencies: c:\dislin\disifl_d.lib c:\dislin\disifd_d.lib user32.lib gdi32.lib      and for a Debug Configuration: Project properties > Linker > Input > Ignore Specific Library: libcmt.lib . The rest (e.g., Fortran project settings) is set as described in the dislin website FAQ.
If there is something I am missing in terms of settings to successfully link the project in VS2015 please let me know (the above settings work with VS2010).

Cheers,
Andi

Helmut Michels

unread,
Sep 9, 2015, 4:51:03 AM9/9/15
to dislin-users
Hi Florent,

I'm now back from vacation and could reproduce the problem. Yes, the static Dislin libraries for Visual C++ are not compatible to
the C++ compiler of Visual Studio 2015. Thank you for the hint. The shareable library (dislnc.lib) is still working. I'm afraid that I have
to create new Dislin distributions for Visual Studio 2015. I hope I can do it in the next days.

Best regards,

Helmut

Helmut Michels

unread,
Oct 2, 2015, 3:36:29 AM10/2/15
to dislin-users
Hi,

the compatibility problem now be solved with the new Dislin upgrade 10.5.4.


Best regards,

Helmut
 
Am Mittwoch, 26. August 2015 17:01:53 UTC+2 schrieb Florent Laroche:

Andi Z

unread,
Oct 2, 2015, 10:26:23 AM10/2/15
to dislin-users
Hi Helmut,

Thanks for upgrading Dislin and fixing this issue.
I tested my programs using the new Dislin 10.5.4. version with Intel Fortran Compiler 16.0 in Visual Studio 2015. It works now as expected for most programs. However, in some programs with dislin I use a customized colour table which I load from a file using the command
CALL VLTFIL("mycolourtable.dat", "LOAD").
There seems to be an issue with this particular dislin feature when used with VS2015 (but not in VS2010). I still get an error at the linker step:
error LNK2019: unresolved external symbol fscanf referenced in function vltfil disifl.lib(VLTFIL.OBJ)

Maybe you missed this one in the latest upgrade (?).

Best regards,
Andi

Helmut Michels

unread,
Oct 5, 2015, 2:57:08 AM10/5/15
to dislin-users
Hi Andi,

it seems that I have forgotten to replace the fscanf routine in VLTFIL. Thank you for the hint. I will correct it and give you a note
when it is finished.

Best regards,

Helmut
Message has been deleted

Florent Laroche

unread,
Jan 13, 2016, 3:39:36 AM1/13/16
to dislin-users
Thanks you very much

Florent
Reply all
Reply to author
Forward
0 new messages