Temple of The Roguelike Forums

Development => Programming => Topic started by: Fenrir on July 23, 2010, 12:51:50 AM

Title: LINK : fatal error LNK1104: cannot open file 'LIBC.lib'
Post by: Fenrir on July 23, 2010, 12:51:50 AM
I setup PDCurses correctly in VC++ 2008, but I'm getting this error message.

"LINK : fatal error LNK1104: cannot open file 'LIBC.lib'"

I'll be damned if I know why this is happening. I don't think it's karma. Fenrir looks thoughtful for a minute. Well, there was that one time in Tijuana─ The great wolf glances around and grins sheepishly. Anyway, anyone know what to do about this off the top of your heads, or do I need to give more information?
Title: Re: LINK : fatal error LNK1104: cannot open file 'LIBC.lib'
Post by: corremn on July 23, 2010, 01:37:33 AM
Visual C cant find the c library to link to.  

I would suggest to try and remove this from you linker settings. (properties/Linker/Input/aditional dependancies.
IIRC Visual C 9.0 will not have this library.  Should be linking to msvcrt.lib anyway.


Did you convert from a VC6 project per chance?
Title: Re: LINK : fatal error LNK1104: cannot open file 'LIBC.lib'
Post by: Fenrir on July 23, 2010, 02:02:10 AM
It isn't a conversion. The odd thing is that it compiled and linked fine before I added a class by right clicking on the "source" folder and clicking "Class..." in the "Add" menu; which is something I've never done.  I don't know why that would be a problem.

All that is in Additional Dependencies is "pdcurses.lib" as it should be.
Title: Re: LINK : fatal error LNK1104: cannot open file 'LIBC.lib'
Post by: corremn on July 23, 2010, 06:40:38 AM
I dont know, Visual Studio should *not* be trying to find this lib.

Anyway start the project from scratch and see if it happens again.
Title: Re: LINK : fatal error LNK1104: cannot open file 'LIBC.lib'
Post by: Fenrir on July 23, 2010, 01:14:10 PM
Bah. It's gremlins. I still get the error.

All I did was set up PDCurses by setting Additional Dependencies to "pdcurses.lib," setting Additional Include Directories and Additional Library Directories to "C:\pdc25_vc_w32".

UPDATE:
I set the Additional Dependencies to "curses.lib" instead and it worked. I still don't know what just happened here, but, as long as it works─ Thanks for the help, corremn.
Title: Re: LINK : fatal error LNK1104: cannot open file 'LIBC.lib'
Post by: Etinarg on July 23, 2010, 01:38:20 PM
Is it possible that pdcurses.lib itself was compiled so that it depends on libc.lib, and the linker recognizes this dependency?

I haven't been using VC so far, so this is pure guessing.
Title: Re: LINK : fatal error LNK1104: cannot open file 'LIBC.lib'
Post by: corremn on July 23, 2010, 02:16:45 PM
Yeah it will be there somewhere.

maybe
Code: [Select]
#pragma comment(lib, "libc.lib") in the code.