Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Cannot open libc.lib (http://forums.winamp.com/showthread.php?t=302413)

TobbeSweden 24th January 2009 20:56

Cannot open libc.lib
 
I'm trying to compile a plugin using Visual Studio 2008, but I get the following error message:

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

How do I solve this? I don't see libc.lib included anywhere, so I don't even know why it's looking for it...

kichik 24th January 2009 21:01

2008 is not supported by SCons. See some recent threads on the subject.

TobbeSweden 25th January 2009 07:14

I know. I'm not using SCons. I'm trying to compile a third-party plugin.

kichik 25th January 2009 22:04

If you're importing a dsp file, remove the libc reference and use the flags in C/C++ properties page (/MT, /MD, etc.).

TobbeSweden 25th January 2009 23:55

I converted/imported the ExDll project from v2.42. I searched through all files, libc.lib is not included anywhere. I tried both /MT and /MD, both give the same result. (Cannot open libc.lib)

I think it's the provided pluginapi.lib file that depends on libc.lib. Is there anything I can do about that?

jimpark 26th January 2009 01:04

You do not need libc.lib with VS 2008. It is implied and links without an explicit libc.lib reference. Remove it from the project.

TobbeSweden 26th January 2009 03:32

From what project? My project (ExDll) does not include libc.lib anywhere.

jimpark 29th January 2009 21:56

Are you compiling via a VS 2008 project or via Scons?

TobbeSweden 29th January 2009 21:59

VS 2008 project

kichik 30th January 2009 16:35

The plug-in library is requesting libc.lib for an unknown reason. I will check it out. You should open a bug report for it.

TobbeSweden 30th January 2009 19:11

Reported.

https://sourceforge.net/tracker/inde...49&atid=373085

kichik 31st January 2009 15:06

I've looked a bit more into it and all files contain that reference. It's the /NODEFAULTLIB flag that cancels them. You should use that flag with VS2008 too and it should work. I don't know how it's called in the GUI but it should be under Linker in Project Settings. Maybe Ignore Default Libraries or something similar.

TobbeSweden 31st January 2009 16:25

This is the output with /NODEFAULTLIB turned on:
code:
1>------ Build started: Project: exdll, Configuration: Debug Win32 ------
1>Compiling...
1>exdll.c
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Linking...
1> Creating library .\Debug/exdll.lib and object .\Debug/exdll.exp
1>exdll.obj : error LNK2019: unresolved external symbol ___security_cookie referenced in function _myFunction
1>exdll.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function _myFunction
1>exdll.obj : error LNK2019: unresolved external symbol @_RTC_CheckStackVars@8 referenced in function _myFunction
1>exdll.obj : error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function _myFunction
1>exdll.obj : error LNK2001: unresolved external symbol __RTC_Shutdown
1>exdll.obj : error LNK2001: unresolved external symbol __RTC_InitBase
1>LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
1>.\Debug/exdll.dll : fatal error LNK1120: 7 unresolved externals
1>Build log was saved at "file://c:\Program\NSIS\Examples\Plugin\Debug\BuildLog.htm"
1>exdll - 8 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Anders 31st January 2009 17:11

specify DllMain as the entry point

kichik 31st January 2009 17:29

And get rid of all the safety checks.

TobbeSweden 1st February 2009 08:09

So I manually defined the entry point and disabled "Buffer Security Check" (/GS-).

I'm now down to the following error messages:
code:
1>------ Build started: Project: exdll, Configuration: Debug Win32 ------
1>Compiling...
1>exdll.c
1>Linking...
1> Creating library .\Debug/exdll.lib and object .\Debug/exdll.exp
1>exdll.obj : error LNK2019: unresolved external symbol @_RTC_CheckStackVars@8 referenced in function _myFunction
1>exdll.obj : error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function _myFunction
1>exdll.obj : error LNK2001: unresolved external symbol __RTC_Shutdown
1>exdll.obj : error LNK2001: unresolved external symbol __RTC_InitBase
1>.\Debug/exdll.dll : fatal error LNK1120: 4 unresolved externals
1>Build log was saved at "file://c:\Program\NSIS\Examples\Plugin\Debug\BuildLog.htm"
1>exdll - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


TobbeSweden 1st February 2009 08:13

Got rid of the last errors by setting "Basic Runtime Checks" to "Default" in the project properties.

kichik 1st February 2009 10:37

Could you post the resulting vcproj/sln so I can include it?

TobbeSweden 1st February 2009 10:57

1 Attachment(s)
Most certainly :)

kichik 1st February 2009 11:06

Thanks.


All times are GMT. The time now is 18:05.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.