Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29270 Discussions

Unresolved Externals

waterresourcesengine
5,438 Views

Up front, I am a 'newbie' to the Intel Visual Fortran Compiler and am facing the 'learning curve...'

I am trying to compile a simple test code; and get the following errors as a partial example.

I have the file IFORT.CFG in the same subdirectory as IFORT.EXE and my test code.

I am setting the PATH, LIB, INCLUDE in the .CFG using the SET command.

Thanks for advice on resolving this.



Microsoft Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.

-out:TESTCODE.exe
-subsystem:console
TESTCODE.obj
TESTCODE.obj : error LNK2019: unresolved external symbol ___intel_new_proc_init referenced in function _MAIN__
TESTCODE.obj : error LNK2019: unresolved external symbol _for_set_reentrancy referenced in function _MAIN__
TESTCODE.obj : error LNK2019: unresolved external symbol _for_write_seq_fmt referenced in function _MAIN__
TESTCODE.obj : error LNK2019: unresolved external symbol _for_read_seq_fmt referenced in function _MAIN__
TESTCODE.obj : error LNK2019: unresolved external symbol _for_stop_core referenced in function _MAIN__
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol __imp__GetCommandLineA@0 referenced in function ___tmainCRTStartup
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol __imp__HeapSetInformation@16 referenced in function ___tmainCRTStartup
LIBCMT.lib(unhandld.obj) : error LNK2019: unresolved external symbol __imp__SetUnhandledExceptionFilter@4 referenced in function ___CxxSetUnhandledExceptionFilter
LIBCMT.lib(invarg.obj) : error LNK2001: unresolved external symbol __imp__SetUnhandledExceptionFilter@4
LIBCMT.lib(gs_report.obj) : error LNK2001: unresolved external symbol __imp__SetUnhandledExceptionFilter@4
LIBCMT.lib(crt0dat.obj) : error LNK2019: unresolved external symbol __imp__GetProcAddress@8 referenced in function ___crtCorExitProcess
LIBCMT.lib(tidtable.obj) : error LNK2001: unresolved external symbol __imp__GetProcAddress@8

continues on with additional LIBCMT 'unresolved externals....'

0 Kudos
24 Replies
waterresourcesengine
799 Views
Steve- attached is the BUILDLOG and .VFPROJ file set; developed as per your suggestions.

Feedback appreciated.

Thanks
0 Kudos
Steven_L_Intel1
Employee
799 Views
Ok - heclib is built with /MT (static libraries), so choosing /libs:dll is wrong. Please set the Use Runtime Library setting to "Multi-threaded" (not Multithreaded DLL and not a Debug version) and see what you get. Attach the buildlog again if it still has errors.
0 Kudos
waterresourcesengine
799 Views
Steve- finally got an EXE !!!!

MANY thanks !!!!

I've still got to do this same process with a 32 bit library but hopefully this will go easier now that I've got the 64 bit version to link with the Library....

Thanks again and Happy Easter.....



0 Kudos
Steven_L_Intel1
Employee
799 Views
Glad to hear it.

By the way, I like to build Fortran libraries with the Libraries > Disable OBJCOMMENT Library Names set to Yes, so that they can be linked with any executable library type, as long as I know the library will be called from Fortran. If it is called from C, then you need to pick the same library setting as C will use.
0 Kudos
Reply