2014-02-07 4 views
2

с gcc Я хочу построить DLL, в котором используется Curl lib.gcc linker error: неопределенная ссылка на `__security_cookie '

После

$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:" тип = имя 'win32' = 'Microsoft.VC90. CRT»против ersion = '9.0.21022.8' processorArchitecture = 'x 86' PublicKeyToken = '1fc8b3b9a1e18e3 Ь'»/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 `@[email protected]' 

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 

Что еще я должен связать, чтобы решить эти проблемы?

Спасибо.

ответ

0

Вам нужно будет связать с одной из библиотек bufferoverflow.lib,

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 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 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.

Смотри на 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 компилятора

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.

Смежные вопросы