Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

Compiles fine under IFC, but under CFC I get unresolveds

Brian_A_
Novice
1,134 Views
Here is what I am getting.
frapd.lib(fulsim.obj) : error LNK2001: unresolved external symbol _FLMDRP@84
frapd.lib(fracas.obj) : error LNK2001: unresolved external symbol _FCMI@200
frapd.lib(ccreep.obj) : error LNK2001: unresolved external symbol _FCMI@200
bin\\fuelsim.exe : fatal error LNK1120: 2 unresolved externals
Here is my make file:
[bash].IGNORE:

!if exist(lib\frap$(NM).lib)
REPLF=lib\frap$(NM).lib
!else
REPLF=
!endif

SRCSF = \
 frap\ans54.f frap\axhef.f frap\axrach.f frap\bes.f frap\bes2.f \
 frap\burnup.f frap\ccreep.f frap\cexpan.f frap\check.f frap\cladf.f \
 frap\cladrp.f frap\cldgro.f frap\clockx.f frap\closex.f frap\conduc.f \
 frap\coneu.f frap\convers.f frap\convtr.f frap\coolt.f frap\corros.f \
 frap\couple.f frap\crap.f frap\crapx.f frap\crdown.f frap\creep.f \
 frap\creepx.f frap\crep1.f frap\crepr.f frap\criip.f frap\driver.f \
 frap\echo1.f frap\edate.f frap\effcon.f frap\emdnsf.f frap\emftc.f \
 frap\emrloc.f frap\emssf2.f frap\energy.f frap\equal1.f frap\equal2.f \
 frap\erfd.f frap\fc2ptr.f frap\fcmi.f frap\fcmi2.f frap\fcrnch.f \
 frap\fenthl.f frap\fexpan.f frap\fgasre.f frap\flmdrp.f frap\fluxd.f \
 frap\fluxdp.f frap\formfa.f frap\fpress.f frap\fr2ptr.f frap\fracas.f \
 frap\fueltp.f frap\fulsim.f frap\gapcls.f frap\gaprs.f frap\gapt.f \
 frap\gaptx.f frap\gasplt.f frap\gaspro.f frap\grafini.f \
 frap\grafout.f \
 frap\gspres.f frap\gtrloc.f frap\inital.f frap\iofiles.f \
 frap\lacinp.f \
 frap\lprt.f frap\massih.f frap\memset.f frap\nemset.f frap\newgap.f \
 frap\newgbgas.f frap\pellet.f frap\pghead.f frap\plnt.f frap\pltinp.f \
 frap\pltout.f frap\pointr.f frap\polate.f frap\print1.f frap\print2.f \
 frap\printm.f frap\pwrdep.f frap\radar.f frap\ratio.f frap\repack.f \
 frap\restfs.f frap\setpnt.f frap\setup.f frap\simq.f frap\store.f \
 frap\strain.f frap\strainx.f frap\stres1.f \
 frap\stress.f frap\stressx.f \
 frap\swell.f frap\tapegn.f frap\terp.f frap\tmpsub.f frap\totgas.f \
 frap\transf.f frap\tubrnp.f frap\turbin.f frap\turbo.f frap\voidp.f \
 frap\volume.f \
 frap\cagrow.f frap\caneal.f frap\caniso.f frap\cbrttl.f \
 frap\cclaps.f frap\ccp.f frap\ccrpr.f frap\celast.f \
 frap\celmod.f frap\cesiod.f frap\cfatig.f frap\chitox.f \
 frap\chscp.f frap\chuptk.f frap\ckmn.f frap\cmhard.f \
 frap\cmlimt.f frap\cobild.f frap\cshear.f frap\csigma.f \
 frap\csrupt.f frap\cstran.f frap\cstres.f frap\cstrni.f \
 frap\cthcon.f frap\cthexp.f frap\ctxtur.f frap\emccp.f \
 frap\emclem.f frap\emcpir.f frap\emcton.f frap\emctxp.f \
 frap\emfcp.f frap\emfeod.f frap\emfess.f frap\emfpir.f \
 frap\emfton.f frap\emftxp.f frap\emgton.f frap\emstrn.f \
 frap\fcp.f frap\fcreep.f frap\felmod.f frap\femiss.f \
 frap\ffracs.f frap\fgasrl.f frap\fhotps.f frap\fpoir.f \
 frap\frestr.f frap\fswell.f frap\fthcon.f frap\fthexp.f \
 frap\fudens.f frap\fvaprs.f frap\gthcon.f frap\gvisco.f \
 frap\phyprp.f frap\propid.f frap\zoemis.f frap\zotcon.f

OBJSF = $(SRCSF:.f=.obj)

f90 = f90
FL = -automatic -pad_source -traceback -fltconsistency -fpconstant

#  Suffix Rules
.SUFFIXES :
.SUFFIXES : .obj .f .h

.f.obj  :
	$(f90) -nologo -c $(FFLAGS) $(FPSTOP) $(FL) \
	-Ifrap -Ilib -object:$*.obj $*.f

#  Explicit Targets

fuelsim.exe:  lib\frapd.lib
	$(f90) -nologo $(FFLAGS) $(FPSTOP) $(FL) \
	frap\driver.obj -libs:qwin lib\frapd.lib \
	-link -out:bin\fuelsim.exe -nodefaultlib:libc.lib

lib\frapd.lib:  $(OBJSF)
	lib -nologo $(REPLF) $? -out:lib\frapd.lib

.PRECIOUS: fuelsim.exe

.IGNORE:
[/bash]
0 Kudos
5 Replies
TimP
Honored Contributor III
1,134 Views
Perhaps you're using a current compiler along with libraries compiled with older options. The 32-bit stdcall style libraries won't work with the cdecl family of objects which have been in use for the last decade.
0 Kudos
Steven_L_Intel1
Employee
1,134 Views
I'm not entirely sure what you are doing. Is "CFC" Compaq Visual Fortran? If so, then you need to know that CVF uses the STDCALL calling convention by default, resulting in the @n suffix to the routine names. If you are trying to link to a library built for use with Intel Fortran, you'll get such errors. You can try adding

-iface:(cref,nomixed_str_len_arg)

to the CVF compile line to see if that helps.

If this does not solve your problem, please provide more detail about which compiler you are using and where the library came from.
0 Kudos
Brian_A_
Novice
1,134 Views
Sorry yes I am using CVF. I started with a clean and then compiled. THe library file is created from the source files upon compiling them.
0 Kudos
Steven_L_Intel1
Employee
1,134 Views
Ok. Most likely the problem is an inconsistency in the number or types of arguments. You could do a:

dumpbin -symbols

on the .lib to get the list of names defined, and look to see what the actual @n value is for the problem names.
0 Kudos
mecej4
Honored Contributor III
1,134 Views
If, as is often the case, you have inconsistent calls to FLMDRP and FCMI, running DUMPBIN on the .OBJ files of the callers compiled with the STDCALL convention will show @nn suffixes on FLMDRP and FCMI that differ from those in the .OBJ or .LIB files where these routines are defined. For example,

_FLMDRP@84
_FLMDRP@80

When you compile with the Intel compiler and do not use /iface:cvf, the linker errors will disappear, but your program will probably crash at run time. Use the /warn:interfaces options to catch these errors.
0 Kudos
Reply