I'm trying to compile a C source code project with Visual Studio 2005. I'm linking in 2 libraries that were built using Visual Studio 2003. When I build my project, I get 1 error:
fatal error LNK1104: cannot open file 'LIBC.lib'
I know libc.lib is not included with Visual Studio 2005. How can I overcome this problem
Thanks,
Mike

fatal error LNK1104: cannot open file 'LIBC.lib'
Ting-fang Zheng
Hello thanks for your anwser,
I will try to get the library sources and compile it in my EXE project, because I have the delivery constraint that there is only one .exe file.
I will also try to make a static library.
I was trying to migrate totally on Visual 2005, it is still impossible, and for developers that only got Visual 2005, it seem hard...
Are you planning to have any improvment on this subject, in a patch or something I always says that Microsoft is very good for retrocompatibility features so I am thinking that this is an issue for you, isn't it
Wish you a happy new year !
Raul Mendoza
Have you tried Sheng Jiang solution mentioned in this thread
Thanks, Ayman Shoukry VC++ TeamSime24
Ram-Sree
-Mike
Steve Moores
Take a look at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=75362&SiteID=1 that deals with a similar issue.
Thanks,
Ayman Shoukry
VC++ Team
Richo
Very sad, I can't use Visual Studio 2005 that seems cool by the way.
zaidm
It is possible!!
The functions, clib.lib exports are already there, so all you need to do is "fool" the compiler. It only needs a library with the name "libc.lib"
So here is what I did: I made a static lib with a single function in it
int donothing() { return 28; }
:)
I compiled it in release mode, called it clib.lib and copied it to the lib folder of visual c 8. Everything was A-OK! (there was a warning though but it's a small price to pay considering the benefits)
Goog luck to all :)
cbenesh
Thanks,
Ayman Shoukry
VC++ Team
BarryTannenbaum
Thanks,
Mike Anderson
Kolchak
Demono
That is because even if you succeed in linking, you might be mixing CRT models which is not a supported scenario.
I am not sure if that would work or not, try adding /nodefaultlib:libc.lib to your linker command.
Thanks,
Ayman Shoukry
VC++ Team
gandor
-Mike
Karl Sumwalt
I'm dealing with exactly the same issue. My program links with six libraries, three of which appear to have been built with VC5. (And for these, "-defaultlib:LIBC" shows up when I run "strings foo.lib | grep LIBC".)
I have the source code for one of these libraries. I rebuilt it, and it went from being 572KB to just over 204MB. (huoh!)
I don't have the source for at least one of the other libraries. It looks like I'm going to have to either rewrite my app to replace that library -- or keep using VS 2003, which works great.
But VS 2003 is becoming hard to find. For the record, I have tested my app with the Intel compiler, and it works extremely well. So maybe the long term option is to switch to VS just as an IDE, and use ICL to do all the work.
David Sceppa