PC Review


Reply
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average.

unresolved external symbol ___security_cookie

 
 
Olivier Lechenne
Guest
Posts: n/a
 
      16th Sep 2003
I am converting some projects from VS 6.0 to VS .NET 2003 and I get a linker
error
error LNK2001: unresolved external symbol ___security_cookie or

error LNK2001: unresolved external symbol ___security_cookie

Does anybody knows where does this symbol comes from? Is it because I am
using a wrong library or have some bad compiler/linker options?



Thanks for any help



Olivier Lechenne

Logitech Inc.


 
Reply With Quote
 
 
 
 
Yan-Hong Huang[MSFT]
Guest
Posts: n/a
 
      17th Sep 2003
Hello Olivier,

Thanks for posting in the group.

When getting the errors:

error LNK2001: unresolved external symbol ___security_cookie
error LNK2001: unresolved external symbol @__security_check_cookie@4

in Visual Studio .NET, it is likely that another library is being pulled
into the project. Add the /verbose:lib switch to the Linker command line
and do a rebuild all. This will output all of the libraries that are being
searched. If you see any libs that live in folders that are not part of
the Microsoft Visual Studio .NET install folder and you are not sure why
they are there, then that is probably the cause of this problem.

Go to Tools | Options | Projects | VC++ Directories and in the Include
Files and Library Files directories check for additional paths that should
not be there.

Also, the "unresolved external symbol ____security_cookie" problem has also
been seen when building DLLs in Visual Studio .NET with the /GS ("buffer
security check") flag. This problem is lightly discussed in the MSDN:

http://msdn.microsoft.com/library/de...us/vccore/html
/vclrfGSBufferSecurity.asp

The workarounds given are:

* Not use arrays in any functions that call (or end up calling) CRT_INIT,
for example, use _alloca instead.
* Let the CRT initialize normally. Don't specify your own entry point, use
DllMain instead (and don't call CRT_INIT).

Does that answer your question?

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!From: "Olivier Lechenne" <(E-Mail Removed)>
!Subject: unresolved external symbol ___security_cookie
!Date: Tue, 16 Sep 2003 10:56:04 -0700
!Lines: 20
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <eZo#(E-Mail Removed)>
!Newsgroups: microsoft.public.dotnet.languages.vc
!NNTP-Posting-Host: amreg.logitech.com 67.17.144.2
!Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.
phx.gbl!TK2MSFTNGP12.phx.gbl
!Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vc:28278
!X-Tomcat-NG: microsoft.public.dotnet.languages.vc
!
!I am converting some projects from VS 6.0 to VS .NET 2003 and I get a
linker
!error
!error LNK2001: unresolved external symbol ___security_cookie or
!
!error LNK2001: unresolved external symbol ___security_cookie
!
!Does anybody knows where does this symbol comes from? Is it because I am
!using a wrong library or have some bad compiler/linker options?
!
!
!
!Thanks for any help
!
!
!
!Olivier Lechenne
!
!Logitech Inc.
!
!
!

 
Reply With Quote
 
 
 
 
Olivier Lechenne
Guest
Posts: n/a
 
      17th Sep 2003
Thanks for your help.
The /GS flag was the culprit since I am building DLLs and SYS files.

Olivier Lechenne
Logitech Inc.
"Yan-Hong Huang[MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello Olivier,
>
> Thanks for posting in the group.
>
> When getting the errors:
>
> error LNK2001: unresolved external symbol ___security_cookie
> error LNK2001: unresolved external symbol @__security_check_cookie@4
>
> in Visual Studio .NET, it is likely that another library is being pulled
> into the project. Add the /verbose:lib switch to the Linker command line
> and do a rebuild all. This will output all of the libraries that are

being
> searched. If you see any libs that live in folders that are not part of
> the Microsoft Visual Studio .NET install folder and you are not sure why
> they are there, then that is probably the cause of this problem.
>
> Go to Tools | Options | Projects | VC++ Directories and in the Include
> Files and Library Files directories check for additional paths that should
> not be there.
>
> Also, the "unresolved external symbol ____security_cookie" problem has

also
> been seen when building DLLs in Visual Studio .NET with the /GS ("buffer
> security check") flag. This problem is lightly discussed in the MSDN:
>
>

http://msdn.microsoft.com/library/de...us/vccore/html
> /vclrfGSBufferSecurity.asp
>
> The workarounds given are:
>
> * Not use arrays in any functions that call (or end up calling) CRT_INIT,
> for example, use _alloca instead.
> * Let the CRT initialize normally. Don't specify your own entry point,

use
> DllMain instead (and don't call CRT_INIT).
>
> Does that answer your question?
>
> Best regards,
> Yanhong Huang
> Microsoft Online Partner Support
>
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no

rights.
>
> --------------------
> !From: "Olivier Lechenne" <(E-Mail Removed)>
> !Subject: unresolved external symbol ___security_cookie
> !Date: Tue, 16 Sep 2003 10:56:04 -0700
> !Lines: 20
> !X-Priority: 3
> !X-MSMail-Priority: Normal
> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> !Message-ID: <eZo#(E-Mail Removed)>
> !Newsgroups: microsoft.public.dotnet.languages.vc
> !NNTP-Posting-Host: amreg.logitech.com 67.17.144.2
> !Path:
>

cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.
> phx.gbl!TK2MSFTNGP12.phx.gbl
> !Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vc:28278
> !X-Tomcat-NG: microsoft.public.dotnet.languages.vc
> !
> !I am converting some projects from VS 6.0 to VS .NET 2003 and I get a
> linker
> !error
> !error LNK2001: unresolved external symbol ___security_cookie or
> !
> !error LNK2001: unresolved external symbol ___security_cookie
> !
> !Does anybody knows where does this symbol comes from? Is it because I am
> !using a wrong library or have some bad compiler/linker options?
> !
> !
> !
> !Thanks for any help
> !
> !
> !
> !Olivier Lechenne
> !
> !Logitech Inc.
> !
> !
> !
>



 
Reply With Quote
 
Yan-Hong Huang[MSFT]
Guest
Posts: n/a
 
      18th Sep 2003
Hi Olivier,

I am glad to hear that the problem is resolved.

Thanks for participating the community.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!From: "Olivier Lechenne" <(E-Mail Removed)>
!References: <eZo#(E-Mail Removed)>
<(E-Mail Removed)>
!Subject: Re: unresolved external symbol ___security_cookie
!Date: Wed, 17 Sep 2003 14:22:39 -0700
!Lines: 99
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!Message-ID: <(E-Mail Removed)>
!Newsgroups: microsoft.public.dotnet.languages.vc
!NNTP-Posting-Host: amreg.logitech.com 67.17.144.2
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
!Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vc:28408
!X-Tomcat-NG: microsoft.public.dotnet.languages.vc
!
!Thanks for your help.
!The /GS flag was the culprit since I am building DLLs and SYS files.
!
!Olivier Lechenne
!Logitech Inc.
!"Yan-Hong Huang[MSFT]" <(E-Mail Removed)> wrote in message
!news:(E-Mail Removed)...
!> Hello Olivier,
!>
!> Thanks for posting in the group.
!>
!> When getting the errors:
!>
!> error LNK2001: unresolved external symbol ___security_cookie
!> error LNK2001: unresolved external symbol @__security_check_cookie@4
!>
!> in Visual Studio .NET, it is likely that another library is being pulled
!> into the project. Add the /verbose:lib switch to the Linker command line
!> and do a rebuild all. This will output all of the libraries that are
!being
!> searched. If you see any libs that live in folders that are not part of
!> the Microsoft Visual Studio .NET install folder and you are not sure why
!> they are there, then that is probably the cause of this problem.
!>
!> Go to Tools | Options | Projects | VC++ Directories and in the Include
!> Files and Library Files directories check for additional paths that
should
!> not be there.
!>
!> Also, the "unresolved external symbol ____security_cookie" problem has
!also
!> been seen when building DLLs in Visual Studio .NET with the /GS ("buffer
!> security check") flag. This problem is lightly discussed in the MSDN:
!>
!>
!http://msdn.microsoft.com/library/de...-us/vccore/htm
l
!> /vclrfGSBufferSecurity.asp
!>
!> The workarounds given are:
!>
!> * Not use arrays in any functions that call (or end up calling)
CRT_INIT,
!> for example, use _alloca instead.
!> * Let the CRT initialize normally. Don't specify your own entry point,
!use
!> DllMain instead (and don't call CRT_INIT).
!>
!> Does that answer your question?
!>
!> Best regards,
!> Yanhong Huang
!> Microsoft Online Partner Support
!>
!> Get Secure! - www.microsoft.com/security
!> This posting is provided "AS IS" with no warranties, and confers no
!rights.
!>
!> --------------------
!> !From: "Olivier Lechenne" <(E-Mail Removed)>
!> !Subject: unresolved external symbol ___security_cookie
!> !Date: Tue, 16 Sep 2003 10:56:04 -0700
!> !Lines: 20
!> !X-Priority: 3
!> !X-MSMail-Priority: Normal
!> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
!> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
!> !Message-ID: <eZo#(E-Mail Removed)>
!> !Newsgroups: microsoft.public.dotnet.languages.vc
!> !NNTP-Posting-Host: amreg.logitech.com 67.17.144.2
!> !Path:
!>
!cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
 
Reply With Quote
 
Olivier Lechenne
Guest
Posts: n/a
 
      26th Sep 2003
How do I figure out how to link to the CRT? I thought that by having the /MT
option defined it would link with the corresponding CRT library
automatically.

Any help is welcome.

Olivier
"Brandon Bray [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Olivier Lechenne wrote:
> > The /GS flag was the culprit since I am building DLLs and SYS files.

>
> Hi Olivier,
> The problem was that the C run-time was not being linked into the DLLs,
> and so the security routines were not found by the linker. Using /GS is
> certainly worthwhile, so if you can figure out how to link in the right

part
> of the CRT, I'd recommend doing so.
>
> Cheerio!
>
> --
> Brandon Bray Visual C++ Compiler
> This posting is provided AS IS with no warranties, and confers no rights.
>
>



 
Reply With Quote
 
Brandon Bray [MSFT]
Guest
Posts: n/a
 
      28th Sep 2003
Olivier Lechenne wrote:
> How do I figure out how to link to the CRT? I thought that by having the
> /MT option defined it would link with the corresponding CRT library
> automatically.


Are you using a different libcmt.lib to link with? The ones installed with
the Visual Studio are in the Vc7\lib directory. If the LIB path is
different, you could be linking with a different CRT.

Cheerio!

--
Brandon Bray Visual C++ Compiler
This posting is provided AS IS with no warranties, and confers no rights.


 
Reply With Quote
 
Jeffrey Klug
Guest
Posts: n/a
 
      29th Sep 2003
You're probably mixing debug and release. That's a no-no.

"Brandon Bray [MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Olivier Lechenne wrote:
> > How do I figure out how to link to the CRT? I thought that by having the
> > /MT option defined it would link with the corresponding CRT library
> > automatically.

>
> Are you using a different libcmt.lib to link with? The ones installed with
> the Visual Studio are in the Vc7\lib directory. If the LIB path is
> different, you could be linking with a different CRT.
>
> Cheerio!
>
> --
> Brandon Bray Visual C++ Compiler
> This posting is provided AS IS with no warranties, and confers no rights.
>
>



 
Reply With Quote
 
New Member
Join Date: May 2011
Posts: 1
 
      6th May 2011
Add link library bufferoverflowU.lib


This link will help you.

http://support.microsoft.com/kb/894573








Quote:
Originally Posted by Olivier Lechenne View Post
I am converting some projects from VS 6.0 to VS .NET 2003 and I get a linker
error
error LNK2001: unresolved external symbol ___security_cookie or

error LNK2001: unresolved external symbol ___security_cookie

Does anybody knows where does this symbol comes from? Is it because I am
using a wrong library or have some bad compiler/linker options?



Thanks for any help



Olivier Lechenne

Logitech Inc.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error LNK2019: unresolved external symbol __imp___Getdateorder ref =?Utf-8?B?SmVubmlmZXI=?= Microsoft Dot NET 0 28th Oct 2004 05:35 AM
LNK2001: unresolved external symbol "void __cdecl free(void *)" (?free@@$$J0YAXPAX@Z) =?Utf-8?B?UWlhb25p?= Microsoft Dot NET 1 25th Mar 2004 07:01 AM
Link error LNK2019: unresolved external symbol AS Microsoft Dot NET Framework 0 2nd Dec 2003 11:52 PM
error LNK2001: unresolved external symbol __HUGE Alek Davis Microsoft VC .NET 1 23rd Sep 2003 07:34 PM
error LNK2019: unresolved external symbol "public: class ATL::CStringT Cris Microsoft VC .NET 0 6th Aug 2003 01:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:23 PM.