- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LINK : fatal error LNK1104: cannot open file 'LIBC.lib'
I am getting this error when trying to compile. If I use -nodefaultlibs:libc.lib, I get a whole bunch of unresolved errors relating to libcmt.lib.
This is my ifort command.
ifort -nologo $(FFLAGS) $(FPSTOP) $(FL) \\
-thread -dbglibs relap\\relap5.$O -libs:qwin lib\\relap$(NM).lib \\
lib\\scdap$(NM).lib lib\\contmn$(NM).lib lib\\matpro$(NM).lib \\
lib\\envrl$(NM).lib lib\\graphics.lib lib\\filechck.lib \\
lib\\opengl32.lib lib\\glaux.lib lib\\glu32.lib lib\\f90gl.lib \\
lib\\f90glu.lib lib\\f90glut.lib lib\\glut32.lib \\
-exe:bin\\relap5.exe
I am compiling on Win7 using IFC 12.0.4.196 Build 20110427
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem here is the -nodefaultlib - this tells the linker to ignore all the compiler directives on which libraries to use. This program needs the QuickWin libraries so all the sources need to be compiled with /libs:qwin and -nodefaultlib removed. Or, add libifqwin.lib to the library set, but you'll probably need more than that.
Link Copied
14 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One of the libraries you are linking to was built with Visual Studio 2003 or earlier. Microsoft dropped libc.lib as of VS2005. You will need to recompile whatever library is making the reference to libc.lib. I will also note that Microsoft dropped glaux.lib as of VS2008.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
None of the librarys in the ifort command were built with the MSVS2003.
$(f90) -nologo $(FFLAGS) $(FPSTOP) $(FL) -libs:qwin \
-thread -dbglibs relap\relap5.$O lib\relap$(NM).lib \
lib\scdap$(NM).lib lib\contmn$(NM).lib lib\matpro$(NM).lib \
lib\envrl$(NM).lib lib\graphics.lib lib\filechck.lib \
lib\opengl32.lib lib\glu32.lib lib\f90gl.lib lib\f90glu.lib \
lib\f90glut.lib lib\glut32.lib -exe:bin\relap5.exe
These are built when I compile:
lib\scdap$(NM).lib lib\contmn$(NM).lib lib\matpro$(NM).lib lib\envrl$(NM).lib lib\graphics.liblib\relap$(NM).lib
These ones are from the latest f90gl download
lib\f90glut.lib lib\glut32.lib lib\opengl32.lib lib\glu32.lib lib\f90gl.lib lib\f90glu.lib
This one is build using the command: makilib filechck.dll
lib\filechck.lib
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure if the previous post is showing up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add at the end of the command that does the linking:
/link /verbose:libs
Do the link (it will probably be a lot of output so redirect it to a file) and attach the output.
/link /verbose:libs
Do the link (it will probably be a lot of output so redirect it to a file) and attach the output.
- 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
- 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
biding my time while waiting for acomplete rebuild of large project (zzzzzz) so took a quick look..
1) you need to fix name relap\relap5.o...is is .obj?
2) your graphics.lib references a number of external procedures, maybe they're are they in relap5??
I'd guess that'syour 'main program' since one of the errors is it can't find you 'main' program...
there's a couple of things to fix
from another brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting bmchenry
1) you need to fix name relap\relap5.o...is is .obj?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
THe .o is for our optimized version and the .obj is for our debug version. Our code is all built from a command line. We doo not use VS to build our application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
relap5 is our main program, any ideas on what to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If your build procedure is set up to substitute .obj for $O, check why that didn't occur when that one was compiled originally. This is not a common idiom, so you need to investigate your procedure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the $O gets set to either .o or .obj depending on if I am compiling a optimized version or a debug version. I am compiling a optimized version. so the file relap5.$O is changed to .o
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem here is the -nodefaultlib - this tells the linker to ignore all the compiler directives on which libraries to use. This program needs the QuickWin libraries so all the sources need to be compiled with /libs:qwin and -nodefaultlib removed. Or, add libifqwin.lib to the library set, but you'll probably need more than that.

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