问题描述
在Visual Studio中编译GOBJECT时,我遇到了以下两个问题错误:
On compiling GOBJECT in Visual Studio, I came across below twoerrors:
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
我使用这里,但像下面这样给./configure
提供了额外的标志.
I recompiled the libffi using the procedure described here but withextra flags given to ./configure
like below.
cflags="-fno-stack-check -fno-stack-protector -mno-stack-arg-probe"
我希望它将摆脱___chkstk_ms调用.
which i hope will get rid of the ___chkstk_ms invocations.
在libffi的make
和make install
之后,我将libffi.a重命名为libffi.lib,将libffi.dll.a重命名为libffi.dll,并将它们复制到适当的目录中.
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.
然后我在Visual Studio中重新构建gobject项目,但遇到了相同的错误我在开始时提到过. :(
Then I re-build the gobject project in visual studio and I got the same errorwhich I mentioned in the beginning. :(
从这篇帖子中,我想问题的根源在于我正在使用两个编译器.但是我没有办法解决它.我试图编译使用Visual Studio Projects的libffi可用,但需要数小时的努力徒劳无功.
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 compilethe libffi using Visual Studio Projects available, but hours of effortswere in vain.
推荐答案
我使用了 Github项目.
但是,您需要将
sizet z = (*p_arg)->size;
到
unsigned long long z = (*p_arg)->size;
因为typedef无效(由于某种原因在这里有效).
because the typedef is not (for some reason effective here).
这篇关于GOBJECT:无法解析的外部符号___chkstk_ms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!