GOBJECT : unresolved externals symbol ___chkstk_ms

隐身守侯 提交于 2019-12-13 09:14:00

问题


On compiling GOBJECT in Visual Studio, I came across below two errors:

Error   5   error LNK1120: 1 unresolved externals   C:\gtk_compilation\glib\glib-2.46.0\build\win32\vs12\Debug\Win32\bin\gobject-2-vs12.dll gobject
Error   4   error LNK2019: unresolved external symbol ___chkstk_ms referenced in function _ffi_call C:\gtk_compilation\glib\glib-2.46.0\build\win32\vs12\libffi.lib(ffi.o)  gobject

I recompiled the libffi using the procedure described here but with extra flags given to ./configure like below.

cflags="-fno-stack-check -fno-stack-protector -mno-stack-arg-probe"

which i hope will get rid of the ___chkstk_ms invocations.

After make and make install of libffi, I renamed the libffi.a to libffi.lib and libffi.dll.a to libffi.dll and copied them to appropriate directories.

Then I re-build the gobject project in visual studio and I got the same error which I mentioned in the beginning. :(

Edit:

From this post, I guess the problem's root is that I am using two compilers. But i don't see a way to get around it. I tried to compile the libffi using Visual Studio Projects available, but hours of efforts were in vain.


回答1:


I resolved this using the MSVC build of Libffi found in the Github project.

However, you need to change the line#606 from

sizet z = (*p_arg)->size;

to

unsigned long long  z = (*p_arg)->size;

because the typedef is not (for some reason effective here).



来源:https://stackoverflow.com/questions/33185622/gobject-unresolved-externals-symbol-chkstk-ms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!