GCC与Microsoft:对`_chkstk'的未定义引用? [英] GCC vs Microsoft : Undefined reference to `_chkstk'?

查看:142
本文介绍了GCC与Microsoft:对`_chkstk'的未定义引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用本质上是GCC的CodeBlocks和MinGW工具链.我当时使用的是VStudio,但我想摆脱它来进行跨平台开发.我链接的某些库中似乎有一些Microsoft特定的引用,特别是在CXImage SDK(_chkstk)中.我认为该库是使用VS组合在一起的.通过搜索,我发现GCC使用_alloca而不是_chkstk.我仍然想将CXImage用于我正在做的一些事情.我的问题:是否有解决此问题的方法,或者如果我想使用GCC,我是否会坚持使用此类库?

I am using CodeBlocks and MinGW toolchain which is essentially GCC. I was using VStudio but I want to get away from it to do cross platform development. There seems to be some microsoft specific references in some libraries that I am linking, specifically in CXImage SDK (_chkstk). I presume the library was put together using VS. From my searches I have learned that GCC uses _alloca rather than _chkstk. I still want to use CXImage for some stuff I am doing. My question: Is there a way around this problem or am I stuck with ditching libs such as this if I want to use GCC?

推荐答案

正如我在评论中所说,您很可能链接到错误的lib文件,因为MinGW/gcc的编译内容与msvc完全不同.始终尝试使用您要用来最终链接它们的编译器从源代码重新编译这些库(如果可以的话).

As I said in my comment, you are most likely linking to the wrong lib files, since MinGW/gcc compiles things very differently from msvc. Always try to recompile the libraries from source with the compiler you are using to eventually link them (if you can).

这篇关于GCC与Microsoft:对`_chkstk'的未定义引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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