gpt4 book ai didi

gcc 链接器错误 : undefined reference to `__security_cookie'

转载 作者:行者123 更新时间:2023-12-04 20:43:36 25 4
gpt4 key购买 nike

gcc我想建一个DLL ,它使用 Curl 库。


$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' 处理器架构='x86' publicKeyToken='1fc8b3b9a1e18e3
b'"/DEFAULTLIB:"MSVCRT"/DEFAULTLIB:"OLDNAMES"' 无法识别

以及以下错误:
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

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

谢谢。

最佳答案

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

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

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

bufferoverflow.lib This library implementsfunctionality for security cookie verification that can be used in theuser mode. However, bufferoverflow.lib is different frombufferoverflowU.lib because bufferoverflow.lib can be used in servicesand in applications that do not use the Win32 API.


查看更多 You may receive the "Linker tools error LNK2001" error messages when you build source code by using the Win32 Software Development Kit (SDK) or the Windows Server 2003 Driver Development Kit (DDK) for Windows Server 2003 Service Pack 1 .
或者,您将不得不在没有 /GS 的情况下重建 curl编译器开关,

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

关于gcc 链接器错误 : undefined reference to `__security_cookie' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21627607/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com