gcc链接器错误:未定义对__security_cookie的引用 [英] gcc linker error: undefined reference to `__security_cookie'

查看:856
本文介绍了gcc链接器错误:未定义对__security_cookie的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

with gcc我想构建一个DLL,它使用Curl库.

with gcc I want to build a DLL, which uses the Curl lib.

之后

$gcc -shared -o GA_TestLibV11.dll GA_TestLibV11.o GA_TestLibV11.def curllib_static.lib

$ gcc -shared -o GA_TestLibV11.dll GA_TestLibV11.o GA_TestLibV11.def curllib_static.lib -llibws2_32

我收到以下警告(多次出现)

警告:.drectve`/manifestdependency:"type ='win32'name ='Microsoft.VC90.CRT'v ersion ='9.0.21022.8'processorArchitecture ='x86'publicKeyToken ='1fc8b3b9a1e18e3 b'"/DEFAULTLIB:" MSVCRT"/DEFAULTLIB:" OLDNAMES'无法识别

Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' v ersion='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3 b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized

以及以下错误:

curllib_static.lib(./Release/easy.obj):(.text[_win32_init]+0x7): undefined reference to `__security_cookie'

curllib_static.lib(./Release/easy.obj):(.text[_win32_init]+0x41): undefined reference to `@__security_check_cookie@4'

c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: curllib_st
atic.lib(./Release/easy.obj): bad reloc address 0x41 in section `.text[_win32_in
it]'
collect2.exe: error: ld returned 1 exit status

要解决这些问题,我还需要链接什么?

What else do I have to link to solve these problems?

谢谢.

推荐答案

您将需要链接到bufferoverflow.lib库之一,

You will need to link with one of the bufferoverflow.lib libraries,

bufferoverflowU.lib 该库实现了安全性功能 可在用户模式和以下模式下使用的cookie验证 使用Win32 API的应用程序.大多数应用程序都与此链接 图书馆.

bufferoverflowU.lib This library implements functionality for security cookie verification that can be used in the user mode and in applications that use the Win32 API. Most applications link to this library.

bufferoverflowK.lib 该库实现对 在操作系统的内核模式下工作的安全性cookie. 必须链接以内核模式运行的服务和子系统 到这个图书馆.

bufferoverflowK.lib This library implements the check of a security cookie that works in the kernel mode of the operating system. Services and subsystems that run in the kernel mode have to be linked to this library.

bufferoverflow.lib 该库实现 可以在 用户模式.但是,bufferoverflow.lib与 bufferoverflowU.lib,因为可以在服务中使用bufferoverflow.lib 以及不使用Win32 API的应用程序中.

bufferoverflow.lib This library implements functionality for security cookie verification that can be used in the user mode. However, bufferoverflow.lib is different from bufferoverflowU.lib because bufferoverflow.lib can be used in services and in applications that do not use the Win32 API.

中查看更多信息,当您通过以下方式生成源代码时,可能会收到链接器工具错误LNK2001"错误消息使用Windows Server 2003 Service Pack 1的Win32软件开发工具包(SDK)或Windows Server 2003驱动程序开发工具包(DDK).

或者,您必须在没有/GS编译器开关的情况下重建 curl

Alternatively, you will have to rebuild curl without the /GS compiler switch,

在Microsoft Visual Studio 2002中,新的编译器开关名为 /GS已引入Microsoft Visual C ++编译器. 设置了"/GS"开关,编译器将注入缓冲区溢出 检测代码中的检测代码.

In Microsoft Visual Studio 2002, a new compiler switch that is named " /GS" has been introduced to the Microsoft Visual C++ compiler. When the " /GS" switch is set, the compiler injects buffer overrun detection code in the compiled code.

这篇关于gcc链接器错误:未定义对__security_cookie的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆