- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all
I have inherited a mixed C++/Fortran application that is kicking out a lot of linking errors. The following objects are kicking out as unresolved. It is either a LNK2001 and LNK2019 error
_for_check_mult_overflow _for_alloc_allocatable referenced in function _RECOREP tracgfor.lib TRACG _for_alloc_allocatable tracgfor.lib TRACG _for_cpystr tracgfor.lib TRACG _for_write_seq_lis_xmit tracgfor.lib TRACG _for_cpstr tracgfor.lib TRACG _for_secnds tracgfor.lib TRACG _for_close tracgfor.lib TRACG _for_open tracgfor.lib TRACG _for_write_seq_fmt tracgfor.lib TRACG _for_rewind tracgfor.lib TRACG _for_read_seq_xmit referenced in function _TR_TRANS tracgfor.lib TRACG _for_write_seq_fmt_xmit tracgfor.lib TRACG _for_inquire tracgfor.lib TRACG _for_trim tracgfor.lib TRACG _for_len_trim tracgfor.lib TRACG _for_write_int_fmt tracgfor.lib TRACG _for_concat tracgfor.lib TRACG @__intel_free_bpv@4 tracgfor.lib TRACG
Any advice? These seems like base fortran calls that I would figure be linked in automatically.
Thanks in advance
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some other important info
I am using Intel 10.1 as the fortran compiler and VS 2008 for the C++ that is linking in the fortran libarry.
I am very much a begineer in this arena so please be very explicit for my sake.
I hope you can help and thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Indications are that the library "tracgfor.lib" was compiled with a different version of the compiler than what you are using, and that the the Fortran runtime libraries of the two versions are not quite compatible. Do you know the pedigree of the library? Can you request the library to be recompiled with a compatible compiler version?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the source code for the library and I build it as a dependent project in the overal solution file. I could do a reinstall of the Fortran compiler do you think that would help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Matthew R. wrote:
I have the source code for the library and I build it as a dependent project in the overal solution file. I could do a reinstall of the Fortran compiler do you think that would help?
I don't know if we need to resort to such desperate measures yet.
What part of your project and library is in C and what part is in Fortran? What was the link command used that produced the linker errors that you listed? Can you post the corresponding build-log file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The main program is C++ and it links in the fortran code. The build file is an html file and the system will not let me upload. I hope this is sufficent
Build Log Build started: Project: TRACG, Configuration: Debug|Win32 Command Lines Creating command line "rc.exe /fo"Debug/TRACG.res" .\TRACG.rc" Creating temporary file "d:\Users\210070673\Desktop\TRACG\Branch\TRACG\TRACG\Debug\RSP00000966046616.rsp" with contents [ /OUT:"D:\Users\210070673\Desktop\TRACG\Branch\TRACG\Debug\TRACG.exe" /INCREMENTAL /LIBPATH:"D:\Users\210070673\Desktop\TRACG\Branch\TRACGFor\TRACGFor\Debug" /LIBPATH:"D:\Users\210070673\Desktop\TRACG\Branch\Libraries" /MANIFEST /MANIFESTFILE:"Debug\TRACG.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\Users\210070673\Desktop\TRACG\Branch\TRACG\Debug\TRACG.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMPAT /MACHINE:X86 libifport.lib ifconsol.lib simrmt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "..\..\tracgfor\tracgfor\debug\tracgfor.lib" ".\Debug\tr_interfa.obj" ".\Debug\TRACG.obj" ".\Debug\TRACG.res" ".\Debug\TRACG.exe.embed.manifest.res" ] Creating command line "link.exe @d:\Users\210070673\Desktop\TRACG\Branch\TRACG\TRACG\Debug\RSP00000966046616.rsp /NOLOGO /ERRORREPORT:PROMPT" Output Window Compiling resources... Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 Copyright (C) Microsoft Corporation. All rights reserved. Linking... tracgfor.lib(recorep.obj) : error LNK2019: unresolved external symbol _for_check_mult_overflow referenced in function _RECOREP tracgfor.lib(graf.obj) : error LNK2001: unresolved external symbol _for_check_mult_overflow tracgfor.lib(init_vh.obj) : error LNK2001: unresolved external symbol _for_check_mult_overflow tracgfor.lib(recorep.obj) : error LNK2019: unresolved external symbol _for_alloc_allocatable referenced in function _RECOREP tracgfor.lib(graf.obj) : error LNK2001: unresolved external symbol _for_alloc_allocatable tracgfor.lib(init_vh.obj) : error LNK2001: unresolved external symbol _for_alloc_allocatable tracgfor.lib(x8d250.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(ichan.obj) : error LNK2019: unresolved external symbol _for_cpystr referenced in function _ICHAN tracgfor.lib(ecomp.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(vsllev.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(conblk.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(wchan.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(wiarr.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(wecompw.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(process_fuel_file_name.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(wecomp.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(vslgeo.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(crnced.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(init_vh.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(grfput.obj) : error LNK2001: unresolved external symbol _for_cpystr tracgfor.lib(wecompc.obj) : error LNK2001: unresolved external symbol _for_cpystr
snip bunch of errors
tracgfor.lib(tsat_s.obj) : error LNK2001: unresolved external symbol _log10f tracgfor.lib(polint.obj) : error LNK2019: unresolved external symbol _for_pause referenced in function _POLINT tracgfor.lib(gapdat.obj) : error LNK2019: unresolved external symbol _for_read_seq_lis referenced in function _GAPDAT tracgfor.lib(gapdat.obj) : error LNK2019: unresolved external symbol _for_read_seq_lis_xmit referenced in function _GAPDAT D:\Users\210070673\Desktop\TRACG\Branch\TRACG\Debug\TRACG.exe : fatal error LNK1120: 65 unresolved externalsResults Build log was saved at "file://d:\Users\210070673\Desktop\TRACG\Branch\TRACG\TRACG\Debug\BuildLog.htm" TRACG - 943 error(s), 0 warning(s)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can attach a ZIP of the HTML file.
My guess is that you didn't add the Fortran library directory to the C++ project settings. See http://software.intel.com/en-us/articles/configuring-visual-studio-for-mixed-language-applications but you'll have to tweak the instructions to accomodate version 10.1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That was set up correctly. I had this in the library directories C:\Program Files (x86)\Intel\Compiler\Fortran\10.1.029\IA32\Lib. I added the line in anyway and still no luck. Were can i find some of these routines can't I just explicitly put the library in there to fix this issue?
any other ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In your Fortran library project, see if the property Fortran > Libraries > Disable Default Library Search Rules is set to "Yes" - if it is, set it to No and rebuild.
If this does not help, set the C executable project property Linker > Show progress to "Show all progress messages" and rebuild. Attach a ZIP of the C project's build log. This will help us figure it out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a chance that the libraries you saved away in your directory, are the 64-bit ones, instead of the 32-bit ones?
the _for_XX names are the IA32 names; the 64-bit libraries contain entry points without the leading underscore.
--Lorri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for all the replies...
I checked the properities of fortran libarry and the main program projects and they are both set to the 32 bit console application setting. Everything I know of is 32 bit. This used to compile but my hard drived crashed and lost everything so I have to start over.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm so sorry, that's not what I was asking. My question is actually outside of Visual Studio.
Your build log shows that it is linking against libraries from D:\Users\210070673\Desktop\TRACG\Branch\Libraries (which I'm pretty sure is not a standard installation location :-) )
When you copied the libraries there, where did you copy them from?
You can check your library the same way I checked one we had in an archive.
Use the command
link /dump /symbols /D:\Users\210070673\Desktop\TRACG\Branch\Libraries\libifcoremt.lib
and then send it to a file (because there will be an amazing amount of output)
Search for the string "for_alloc_allocatable".
Is it found, but without the leading underscore?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree with Lorri that you probably copied the wrong Fortran libraries. But if you've added the 10.1 library folder, why do you have your own copies of the Intel Fortran libraries in that folder? I suggest renaming them or deleting them (libifcoremt.lib, libifport.lib, ifconsol.lib, libirc.lib, svml_disp.lib, ifwin.lib) and allowing the linker to find them in the Fortran product directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That did it!!!
Thank you all so much. Was banging my head against the wall for weeks on this!!!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page