ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • error LNK2001: unresolved external symbol ___security_cookie
    VisualStudio 2008. 2. 29. 00:38


    정적라이브러리를 하나만들어 어떤 프로젝트에 사용할 일이 있었습니다.
    그런데 아래와 같은 에러가 떴습니다.
    제가 만든 라이브러리에서는 아래 3가지 함수를 전혀 사용하지 않는데 왜 이런 오류가 생기는 걸까..
    하면서 삽질을 많이 했습니다.

    이리저리 헤매다가
    VS.net (2003) 으로 만든 정적라이브러리를 VS 6에서 사용할때 아래와 같은 오류가 발생한다는것을 알았습니다.

    아직도 정확한 원인은 잘 모르겠습니다.

    저는 시간이 없었던 관계로 그냥 라이브러리를 vs6에서 새로 컴파일을 해버렸습니다.

    그랬더니 잘되더군요..

    TestLib.lib(TestLib.obj) : error LNK2001: unresolved external symbol ___security_cookie
    TestLib.lib(TestLib.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
    TestLib.lib(TestLib.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (
    ??_V@YAXPAX@Z)
    Debug/Te.exe : fatal error LNK1120: 3 unresolved externals



    아래는 구글에서 이리 저리 찾아다니다가 해답이 되는 소리인거 같은데 영어가 딸려서
    긁어왔습니다.

    http://www.thescripts.com/forum/thread264352.html
    Olivier Lechenne  
    프로필 보기
     추가 옵션 2003년9월17일, 오전2시59분
    뉴스그룹: microsoft.public.dotnet.languages.vc
    보낸 사람: "Olivier Lechenne" <olivier_leche...@logitech.com>
    날짜: Tue, 16 Sep 2003 10:56:04 -0700
    지역: 2003년9월17일(수) 오전2시56분
    제목: unresolved external symbol ___security_cookie
    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.


    메시지를 게시하려면 그룹에 가입해야 합니다.
    메시지를 게시하려면 먼저 해당 그룹에 가입하셔야 합니다.
    게시하기 전에 가입 설정 페이지에서 닉네임을 업데이트하십시오.
    메시지를 게시할 수 있는 권한이 없습니다.
    Yan-Hong Huang[MSFT]  
    프로필 보기
     추가 옵션 2003년9월17일, 오후12시41분
    뉴스그룹: microsoft.public.dotnet.languages.vc
    보낸 사람: yhhu...@online.microsoft.com (Yan-Hong Huang[MSFT])
    날짜: Wed, 17 Sep 2003 03:41:13 GMT
    지역: 2003년9월17일(수) 오후12시41분
    제목: RE: unresolved external symbol ___security_cookie
    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/default.asp?url=/library/en-us/vcco...

    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.

Designed by Tistory.