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

My problem with libirc.lib

hupo1982
Beginner
891 Views
we compiled our fortran code with CVF6.0,now we want to develop a 64bit program,so we have to use Intel VF9.0 to compile our Fortran code.We compile our project which have Fortran code and C++ code with "nmake" in command line.But we got this error when it was linking:
libirc.lib:error LNK2019: unresolved external symbol _iob referenced in function __intel_alloc_bpv
if I add "/nodefaultlib:"libirc.lib" " into my makefile,I got another error:
myproject.obj : error LNK2019: unresolved external symbol __intel_alloc_bpv referenced in function MYFUN
myproject.obj : error LNK2019: unresolved external symbol __intel_free_bpv referenced in function MYFUN
I think this error was caused by the code "FORMAT(A,X,I7,'P',I7)" in MYFUN.
How can I fix it?
0 Kudos
8 Replies
Steven_L_Intel1
Employee
891 Views
Do not use /nodefaultlib. It almost always makes things worse.

How are you compiling the Fortran sources and how are you linking?
0 Kudos
hupo1982
Beginner
891 Views
I give :
"F90=E:IFORT.exe
F90_PROJ=/browser:"Debug64/" /compile_only /debug:full /fpscomp:ioformat /include:"$(INTDIR)" /include:"Debug/" /include:"....includecom" /libs:dll /math_library:fast /nologo /reentrancy:threaded /traceback /warn:argument_checking /warn:nofileopt /module:"Debug64/" /object:"Debug64/" /pdbfile:"Debug64/DF60.PDB"
F90_OBJS=.Debug64/"
in my makefile.
0 Kudos
Steven_L_Intel1
Employee
891 Views
And what is the line in the makefile for linking the application?
0 Kudos
hupo1982
Beginner
891 Views
LINK32=link.exe
LINK32_FLAGS=htmlhelp.lib liblssecurity_mtdll.lib opengl32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib glu32.lib netapi32.lib ws2_32.lib bufferoverflowu.lib /stack:0x989680 /subsystem:console /profile /debug /machine:IX86 /nodefaultlib:"libcmt.lib" /nodefaultlib:"msvcrt.lib" /nodefaultlib:"libcd.lib" /out:"myproject.exe" /libpath:"..lib" /libpath:"../../lib64" /machine:AMD64
0 Kudos
Steven_L_Intel1
Employee
891 Views
I am always suspicious of uses of /nodefaultlib. They cause more problems than they solve. Usually attempts to work around linking problems with /nodefaultlib are better addressed by specifying the proper library switch to the compilations.

I suspect that in your case you have a lot of non-Fortran libraries which require linking against specific versions of MSVC libraries. I am not familiar with all of them, so the only advice I can offer now is to go back to the beginning and make sure that all sources are compiled with compatible settings for which run-time libraries are to be used.

Also, make sure that you have run ifortvars.bat to start your command session that runs the makefile. This is done automatically when you use the "Build Environment" shortcut in the Intel Visual Fortran program group.
0 Kudos
TimP
Honored Contributor III
891 Views
What is the implication of setting IX86 and changing later to AMD64? 32-bit objects can't be expected to work when linked together with 64-bit objects.
0 Kudos
Steven_L_Intel1
Employee
891 Views
Normally, I would expect the rightmost switch to take precedence, but in any case, it would affect running the program, not linking. I agree that having both in there is an error.
0 Kudos
jxbking
Beginner
891 Views
I have meet same problem (__intel_alloc_bpv) when compile a 64 bit program. I am sureit's not about IX86 and AMD64 flag(In a small project with these flags, is OK ).
And I found why it happed. When use FORMAT, like this
WRITE(6,FMT=30) INT2, INT3
30 FORMAT(I, I<2*M>)
This bug happend. Can anyone help me?
0 Kudos
Reply