Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

i have added some built in lib files in my VC code
when i built my code it gives me error that functions like fclose ,fseek , fcloseall
these are already declared . means in buit in lib files which code i can not see these functions are also declare there.

is there any way that i told my program not to use built in VC fclose , fseek function only use by default lib which is added that functions.

NOTE:
this problem arise if i use VC 6.0

Tis problem is not in "VISUAL STUDIO 8.0 C"
or "Visual Studio 10.0 C"

plz help how to skip VC built in function to use in my code
of vc6.0



Erroes which comes VC 6.0 are

VB
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBCD.lib(fflush.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _signal already defined in LIBCD.lib(winsig.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
lapack.lib(dlartg.obj) : error LNK2001: unresolved external symbol __ftol2_sse
libf2c.lib(i_nint.obj) : error LNK2001: unresolved external symbol __ftol2_sse
lapack.lib(dggbak.obj) : error LNK2001: unresolved external symbol __ftol2_sse
lapack.lib(dggbal.obj) : error LNK2001: unresolved external symbol __ftol2_sse
lapack.lib(dlamch.obj) : error LNK2001: unresolved external symbol __ftol2_sse
lapack.lib(ilaenv.obj) : error LNK2001: unresolved external symbol __ftol2_sse
lapack.lib(ilaenv.obj) : error LNK2001: unresolved external symbol ___security_cookie
libf2c.lib(open.obj) : error LNK2001: unresolved external symbol ___security_cookie
libf2c.lib(wref.obj) : error LNK2001: unresolved external symbol ___security_cookie
libf2c.lib(endfile.obj) : error LNK2001: unresolved external symbol ___security_cookie
lapack.lib(ilaenv.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libf2c.lib(open.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libf2c.lib(wref.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libf2c.lib(endfile.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4




HERE lapack libf2c are lib files which i added in my program to use thier functions .

plz help Thanks
Posted
Updated 18-Aug-14 19:31pm
v2
Comments
CPallini 6-Aug-14 6:47am    
Could you please, post the exact error message?
prog786 19-Aug-14 1:29am    
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fflush already defined in LIBCD.lib(fflush.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBCD.lib(crt0dat.obj)
MSVCRT.lib(MSVCRT.dll) : error LNK2005: _signal already defined in LIBCD.lib(winsig.obj)
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
lapack.lib(dlartg.obj) : error LNK2001: unresolved external symbol __ftol2_sse
libf2c.lib(i_nint.obj) : error LNK2001: unresolved external symbol __ftol2_sse
lapack.lib(dggbak.obj) : error LNK2001: unresolved external symbol __ftol2_sse
lapack.lib(dggbal.obj) : error LNK2001: unresolved external symbol __ftol2_sse
lapack.lib(dlamch.obj) : error LNK2001: unresolved external symbol __ftol2_sse
lapack.lib(ilaenv.obj) : error LNK2001: unresolved external symbol __ftol2_sse
lapack.lib(ilaenv.obj) : error LNK2001: unresolved external symbol ___security_cookie
libf2c.lib(open.obj) : error LNK2001: unresolved external symbol ___security_cookie
libf2c.lib(wref.obj) : error LNK2001: unresolved external symbol ___security_cookie
libf2c.lib(endfile.obj) : error LNK2001: unresolved external symbol ___security_cookie
lapack.lib(ilaenv.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libf2c.lib(open.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libf2c.lib(wref.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
libf2c.lib(endfile.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4

You have some lib mismatch. Change the linker settings to such types as your included libs are. And check which libs do dont need.

There is also the linker setting "/FORCE" but it is only a hack or workaround for testing.
 
Share this answer
 
Try this linker "NODEFAULTLIB" option:

http://msdn.microsoft.com/en-us/library/3tz4da4a.aspx[^]
 
Share this answer
 
The error message:
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library

tells you how to resolve this problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900